mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-27 14:59:37 +02:00
Add custom icons to bookmarks (#5)
* allow custom icons for bookmarks * update docker-image action to tag images based on source branch
This commit is contained in:
parent
de51659647
commit
d020fd4c0f
3 changed files with 13 additions and 8 deletions
|
@ -42,8 +42,8 @@ const BookmarkForm = (props: ComponentProps): JSX.Element => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const [bookmarkData, setBookmarkData] = useState<NewBookmark>({
|
const [bookmarkData, setBookmarkData] = useState<NewBookmark>({
|
||||||
name: '',
|
name: "",
|
||||||
url: '',
|
url: "",
|
||||||
categoryId: -1,
|
categoryId: -1,
|
||||||
icon: '',
|
icon: '',
|
||||||
});
|
});
|
||||||
|
@ -68,8 +68,8 @@ const BookmarkForm = (props: ComponentProps): JSX.Element => {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setBookmarkData({
|
setBookmarkData({
|
||||||
name: '',
|
name: "",
|
||||||
url: '',
|
url: "",
|
||||||
categoryId: -1,
|
categoryId: -1,
|
||||||
icon: '',
|
icon: '',
|
||||||
});
|
});
|
||||||
|
@ -113,7 +113,6 @@ const BookmarkForm = (props: ComponentProps): JSX.Element => {
|
||||||
} else {
|
} else {
|
||||||
props.addBookmark(bookmarkData);
|
props.addBookmark(bookmarkData);
|
||||||
}
|
}
|
||||||
|
|
||||||
setBookmarkData({
|
setBookmarkData({
|
||||||
name: "",
|
name: "",
|
||||||
url: "",
|
url: "",
|
||||||
|
|
|
@ -50,10 +50,10 @@ const Bookmarks = (props: ComponentProps): JSX.Element => {
|
||||||
updatedAt: new Date(),
|
updatedAt: new Date(),
|
||||||
});
|
});
|
||||||
const [bookmarkInUpdate, setBookmarkInUpdate] = useState<Bookmark>({
|
const [bookmarkInUpdate, setBookmarkInUpdate] = useState<Bookmark>({
|
||||||
name: "",
|
name: "string",
|
||||||
url: "",
|
url: "string",
|
||||||
categoryId: -1,
|
categoryId: -1,
|
||||||
icon: "",
|
icon: "string",
|
||||||
isPinned: false,
|
isPinned: false,
|
||||||
orderId: 0,
|
orderId: 0,
|
||||||
id: 0,
|
id: 0,
|
||||||
|
|
|
@ -13,6 +13,12 @@ exports.createBookmark = asyncWrapper(async (req, res, next) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
let bookmark;
|
let bookmark;
|
||||||
|
let _body = { ...req.body };
|
||||||
|
|
||||||
|
if (req.file) {
|
||||||
|
_body.icon = req.file.filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
let _body = {
|
let _body = {
|
||||||
...req.body,
|
...req.body,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue