From 26f6a63b1ac098c923918b24a683d26b801c3a3a Mon Sep 17 00:00:00 2001 From: franco sanchez Date: Thu, 14 Nov 2024 13:30:10 -0300 Subject: [PATCH] fix: an error was solved with a type --- src/components/modals/ModalCollection.tsx | 2 +- src/hooks/queries.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/modals/ModalCollection.tsx b/src/components/modals/ModalCollection.tsx index f287429..3aec95a 100644 --- a/src/components/modals/ModalCollection.tsx +++ b/src/components/modals/ModalCollection.tsx @@ -101,7 +101,7 @@ export function ModalCollection({ e.preventDefault(); if (!isPending) { - if (isEditing && collectionId) { + if (isEditing) { mutate(name); } else { mutate(name); diff --git a/src/hooks/queries.ts b/src/hooks/queries.ts index 015c6ea..8876c5f 100644 --- a/src/hooks/queries.ts +++ b/src/hooks/queries.ts @@ -283,7 +283,7 @@ function useAllFavoriteByUser(userId: string | undefined) { function useCreateCollections(userId: string | undefined) { return useMutation({ mutationKey: [keys.createCollections], - mutationFn: (name: string | undefined) => postCollections(userId, name), + mutationFn: (name: string) => postCollections(userId, name), }); }