Change tags to use uids instead of ids. (#351)
* Small cleanups * Change tags to use uid instead of id. --------- Co-authored-by: antanst <>
This commit is contained in:
parent
8b01e456b3
commit
70956f9ecd
17 changed files with 97 additions and 133 deletions
|
|
@ -288,15 +288,15 @@ const Layout: React.FC<LayoutProps> = ({
|
|||
const handleSaveTag = async (tagData: Tag) => {
|
||||
try {
|
||||
let result: Tag;
|
||||
if (tagData.id) {
|
||||
result = await updateTag(tagData.id, tagData);
|
||||
if (tagData.uid) {
|
||||
result = await updateTag(tagData.uid, tagData);
|
||||
// Update existing tag in global store
|
||||
const currentTags = useStore.getState().tagsStore.tags;
|
||||
useStore
|
||||
.getState()
|
||||
.tagsStore.setTags(
|
||||
currentTags.map((tag) =>
|
||||
tag.id === result.id ? result : tag
|
||||
tag.uid === result.uid ? result : tag
|
||||
)
|
||||
);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue