fix #11: unable to delete category

This commit is contained in:
Vasily Zubarev
2025-04-07 11:30:30 +02:00
parent f342007676
commit ec72b45ed8
3 changed files with 5 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ export const getCategories = cache(async (userId: string) => {
export const getCategoryByCode = cache(async (userId: string, code: string) => {
return await prisma.category.findUnique({
where: { userId_code: { code, userId } },
where: { userId_code: { userId, code } },
})
})
@@ -40,13 +40,13 @@ export const createCategory = async (userId: string, category: CategoryData) =>
export const updateCategory = async (userId: string, code: string, category: CategoryData) => {
return await prisma.category.update({
where: { userId_code: { code, userId } },
where: { userId_code: { userId, code } },
data: category,
})
}
export const deleteCategory = async (userId: string, code: string) => {
return await prisma.category.delete({
where: { userId_code: { code, userId } },
where: { userId_code: { userId, code } },
})
}