cleaner code

This commit is contained in:
Daniel
2023-05-27 21:19:09 +03:30
parent 632548e54a
commit aef0a90f43
8 changed files with 246 additions and 288 deletions
+4 -2
View File
@@ -12,8 +12,8 @@ type LinkStore = {
links: LinkIncludingCollectionAndTags[];
setLinks: () => void;
addLink: (body: LinkIncludingCollectionAndTags) => Promise<boolean>;
updateLink: (link: LinkIncludingCollectionAndTags) => void;
removeLink: (link: LinkIncludingCollectionAndTags) => void;
updateLink: (link: LinkIncludingCollectionAndTags) => Promise<boolean>;
removeLink: (link: LinkIncludingCollectionAndTags) => Promise<boolean>;
};
const useLinkStore = create<LinkStore>()((set) => ({
@@ -70,6 +70,8 @@ const useLinkStore = create<LinkStore>()((set) => ({
useTagStore.getState().setTags();
useCollectionStore.getState().setCollections();
}
return response.ok;
},
removeLink: async (link) => {
const response = await fetch("/api/routes/links", {