From 125a222413ea75d182ae64da5f1534e1a884c35d Mon Sep 17 00:00:00 2001 From: seoyeoneel02 Date: Fri, 13 Sep 2024 22:33:03 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=8B=A4=EC=B8=A1=EC=82=AC=EC=9D=B4?= =?UTF-8?q?=EC=A6=88=20=EC=82=AD=EC=A0=9C=20=EB=A1=9C=EC=A7=81=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=20#126?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/domains/closet/closet.dao.js | 7 ++++--- src/domains/closet/closet.sql.js | 5 ++++- src/swagger/closet.swagger.yaml | 13 ++++++++----- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/domains/closet/closet.dao.js b/src/domains/closet/closet.dao.js index 2a38d7e..da60484 100644 --- a/src/domains/closet/closet.dao.js +++ b/src/domains/closet/closet.dao.js @@ -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, myClothDel } from "./closet.sql.js"; + updateCloth, updateRealSize, myClothSizeDel, myClothDel } from "./closet.sql.js"; // cloth 반환 export const getMyClosetPreview = async (userId, name, category) => { @@ -153,8 +153,9 @@ export const clothPut = async (data) => { export const clothDel = async (userId, clothId) => { try { const conn = await pool.getConnection(); - pool.query(myClothDel, [userId, clothId]); - const cloth = await pool.query(getCloth, clothId); + await pool.query(myClothSizeDel, parseInt(clothId)); + await pool.query(myClothDel, [userId, parseInt(clothId)]); + const cloth = await pool.query(getCloth, parseInt(clothId)); console.log(cloth); if(!cloth[0].length == 0){ diff --git a/src/domains/closet/closet.sql.js b/src/domains/closet/closet.sql.js index 5574e29..6aa4fad 100644 --- a/src/domains/closet/closet.sql.js +++ b/src/domains/closet/closet.sql.js @@ -67,5 +67,8 @@ export const updateRealSize = "UPDATE real_size SET length=?, shoulder=?, chest=?, armhole=?, sleeve=?, sleeve_length=?, hem=? " + "WHERE cloth_id = ? " +export const myClothSizeDel = +"DELETE FROM real_size WHERE cloth_id = ? ;" -export const myClothDel = "DELETE FROM cloth WHERE uuid = ? AND id = ? ;" \ No newline at end of file +export const myClothDel = +"DELETE FROM cloth WHERE uuid = ? AND id = ? ;" \ No newline at end of file diff --git a/src/swagger/closet.swagger.yaml b/src/swagger/closet.swagger.yaml index 93bf74c..d78906d 100644 --- a/src/swagger/closet.swagger.yaml +++ b/src/swagger/closet.swagger.yaml @@ -10,7 +10,7 @@ paths: tags: - Closet summary: 내 옷장 조회 로직 - operationId: closet + operationId: closetPreview security: - bearerAuth: [] parameters: @@ -107,6 +107,7 @@ paths: tags: - Closet summary: 내 옷 상세 조회 로직 + operationId: closetView security: - bearerAuth: [] parameters: @@ -235,7 +236,7 @@ paths: tags: - Closet summary: 브랜드 조회 로직 - operationId: closet + operationId: getBrand parameters: - name: name in: query @@ -294,7 +295,7 @@ paths: tags: - Closet summary: 브랜드 등록 로직 - operationId: closet + operationId: addBrand requestBody: required: true content: @@ -377,7 +378,7 @@ paths: tags: - Closet summary: 옷 직접 등록 로직 - operationId: closet + operationId: addCloth security: - bearerAuth: [] requestBody: @@ -527,7 +528,7 @@ paths: tags: - Closet summary: 옷 이미지 업로드 - operationId: closet + operationId: addClothImg security: - bearerAuth: [] requestBody: @@ -605,6 +606,7 @@ paths: tags: - Closet summary: 내 옷 수정 로직 + operationId: putCloth security: - bearerAuth: [] parameters: @@ -755,6 +757,7 @@ paths: tags: - Closet summary: 내 옷 삭제 로직 + operationId: delCloth security: - bearerAuth: [] parameters: