ui improvements

This commit is contained in:
Daniel
2023-03-25 17:47:34 +03:30
parent 2e3ec53d2a
commit 3a5ae28f86
17 changed files with 117 additions and 55 deletions
+6 -1
View File
@@ -1,5 +1,7 @@
import { create } from "zustand";
import { ExtendedLink, NewLink } from "@/types/global";
import useTagStore from "./tags";
import useCollectionStore from "./collections";
type LinkStore = {
links: ExtendedLink[];
@@ -34,6 +36,9 @@ const useLinkStore = create<LinkStore>()((set) => ({
links: [...state.links, data.response],
}));
useTagStore.getState().setTags();
useCollectionStore.getState().setCollections();
return response.ok;
},
updateLink: (link) =>
@@ -56,7 +61,7 @@ const useLinkStore = create<LinkStore>()((set) => ({
links: state.links.filter((e) => e.id !== link.id),
}));
console.log(data);
useTagStore.getState().setTags();
return response.ok;
},