카테고리 이름 변경 및 삭제, 카테고리에서 파일 삭제 구현

This commit is contained in:
static committed 2025-01-22 15:39:48 +09:00
1 parent 4c0d668cc1
commit 368868910d
20 files changed
+507 -54

No files matched your search

+5 -2
View File
@@ -136,9 +136,12 @@ export const setCategoryEncName = async (
};
export const unregisterCategory = async (userId: number, categoryId: number) => {
await db
const res = await db
.deleteFrom("category")
.where("id", "=", categoryId)
.where("user_id", "=", userId)
.execute();
.executeTakeFirst();
if (res.numDeletedRows === 0n) {
throw new IntegrityError("Category not found");
}
};