Skip to content

Commit

Permalink
Merge pull request #131 from UMC-FITple/fix/#130_backend_wish-cloth-del
Browse files Browse the repository at this point in the history
wish 삭제 로직 구현
  • Loading branch information
seoyeoneel02 authored Sep 25, 2024
2 parents 9195fb0 + 8fc4612 commit 9922ee1
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 9922ee1

Please sign in to comment.