Pass the entire link to the store & fix bulk update function

This commit is contained in:
Isaac Wise
2024-02-10 15:53:46 -06:00
parent da0533ac36
commit 582607e726
9 changed files with 52 additions and 107 deletions
+2 -2
View File
@@ -111,14 +111,14 @@ export default function Index() {
if (selectedLinks.length === links.length) {
setSelectedLinks([]);
} else {
setSelectedLinks(links.map((e) => e.id));
setSelectedLinks(links.map((link) => link));
}
};
const bulkDeleteLinks = async () => {
const load = toast.loading(`Deleting ${selectedLinks.length} Link${selectedLinks.length > 1 ? "s" : ""}...`);
const response = await deleteLinksById(selectedLinks);
const response = await deleteLinksById(selectedLinks.map((link) => link.id));
toast.dismiss(load);