Skip to content

Commit

Permalink
feat: wish 삭제 코드 추가 #130
Browse files Browse the repository at this point in the history
  • Loading branch information
seoyeoneel02 committed Sep 23, 2024
1 parent 7abe3c4 commit 3b9880c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/domains/closet/closet.dao.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { status } from "../../config/response.status.js";
import { myClosetItem, myClosetCategoryItem, myClosetSearchItem, myClosetSearchCategoryItem,
getClothByClothId, getUserByClothId, getRealSizeByClothId,
brandToBrandName, insertBrand, getBrand, insertCloth, insertRealSize, getCloth,
updateCloth, updateRealSize, myClothSizeDel, myClothDel } from "./closet.sql.js";
updateCloth, updateRealSize, myClothSizeDel, myClothWishDel, myClothDel } from "./closet.sql.js";

// cloth 반환
export const getMyClosetPreview = async (userId, name, category) => {
Expand Down Expand Up @@ -154,6 +154,7 @@ export const clothDel = async (userId, clothId) => {
try {
const conn = await pool.getConnection();
await pool.query(myClothSizeDel, parseInt(clothId));
await pool.query(myClothWishDel, parseInt(clothId));
await pool.query(myClothDel, [userId, parseInt(clothId)]);
const cloth = await pool.query(getCloth, parseInt(clothId));

Expand Down
3 changes: 3 additions & 0 deletions src/domains/closet/closet.sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,8 @@ export const updateRealSize =
export const myClothSizeDel =
"DELETE FROM real_size WHERE cloth_id = ? ;"

export const myClothWishDel =
"DELETE FROM wish WHERE cloth_id = ? ;"

export const myClothDel =
"DELETE FROM cloth WHERE uuid = ? AND id = ? ;"

0 comments on commit 3b9880c

Please sign in to comment.