From fda782ec440b490d4283ef98719de06c941ecb78 Mon Sep 17 00:00:00 2001 From: Isaac Wise Date: Sat, 10 Feb 2024 16:25:38 -0600 Subject: [PATCH] revert previous change --- components/ModalContent/BulkDeleteLinksModal.tsx | 2 +- components/ModalContent/BulkEditLinksModal.tsx | 1 - pages/collections/[id].tsx | 2 +- types/global.ts | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/ModalContent/BulkDeleteLinksModal.tsx b/components/ModalContent/BulkDeleteLinksModal.tsx index 511e5ee..61c5fb3 100644 --- a/components/ModalContent/BulkDeleteLinksModal.tsx +++ b/components/ModalContent/BulkDeleteLinksModal.tsx @@ -13,7 +13,7 @@ export default function BulkDeleteLinksModal({ onClose }: Props) { const deleteLink = async () => { const load = toast.loading(`Deleting ${selectedLinks.length} Link${selectedLinks.length > 1 ? "s" : ""}...`); - const response = await deleteLinksById(selectedLinks.map(link => link.id)); + const response = await deleteLinksById(selectedLinks.map(link => link.id as number)); toast.dismiss(load); diff --git a/components/ModalContent/BulkEditLinksModal.tsx b/components/ModalContent/BulkEditLinksModal.tsx index 4086ff6..0a11ac5 100644 --- a/components/ModalContent/BulkEditLinksModal.tsx +++ b/components/ModalContent/BulkEditLinksModal.tsx @@ -29,7 +29,6 @@ export default function BulkEditLinksModal({ onClose }: Props) { if (!submitLoader) { setSubmitLoader(true); - const load = toast.loading("Updating..."); const response = await updateLinks(selectedLinks, updatedValues); diff --git a/pages/collections/[id].tsx b/pages/collections/[id].tsx index d8ad531..eb4a1aa 100644 --- a/pages/collections/[id].tsx +++ b/pages/collections/[id].tsx @@ -122,7 +122,7 @@ export default function Index() { const bulkDeleteLinks = async () => { const load = toast.loading(`Deleting ${selectedLinks.length} Link${selectedLinks.length > 1 ? "s" : ""}...`); - const response = await deleteLinksById(selectedLinks.map((link) => link.id)); + const response = await deleteLinksById(selectedLinks.map((link) => link.id as number)); toast.dismiss(load); diff --git a/types/global.ts b/types/global.ts index 717d046..3c8de79 100644 --- a/types/global.ts +++ b/types/global.ts @@ -9,7 +9,7 @@ export interface LinkIncludingShortenedCollectionAndTags Link, "id" | "createdAt" | "collectionId" | "updatedAt" | "lastPreserved" > { - id: number; + id?: number; createdAt?: string; collectionId?: number; tags: Tag[];