mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 23:18:48 +00:00
카테고리 이름 변경 및 삭제, 카테고리에서 파일 삭제 구현
This commit is contained in:
@@ -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");
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user