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), }); }