Skip to content

Commit

Permalink
Merge branch 'dev' into feat/#124_backend_recommend-style #124
Browse files Browse the repository at this point in the history
  • Loading branch information
seoyeoneel02 committed Sep 20, 2024
2 parents cd6ce08 + d4e33ff commit d4ae5eb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
7 changes: 4 additions & 3 deletions 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, myClothDel } from "./closet.sql.js";
updateCloth, updateRealSize, myClothSizeDel, myClothDel } from "./closet.sql.js";

// cloth 반환
export const getMyClosetPreview = async (userId, name, category) => {
Expand Down Expand Up @@ -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){
Expand Down
5 changes: 4 additions & 1 deletion src/domains/closet/closet.sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ? ;"
export const myClothDel =
"DELETE FROM cloth WHERE uuid = ? AND id = ? ;"
13 changes: 8 additions & 5 deletions src/swagger/closet.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ paths:
tags:
- Closet
summary: 내 옷장 조회 로직
operationId: closet
operationId: closetPreview
security:
- bearerAuth: []
parameters:
Expand Down Expand Up @@ -107,6 +107,7 @@ paths:
tags:
- Closet
summary: 내 옷 상세 조회 로직
operationId: closetView
security:
- bearerAuth: []
parameters:
Expand Down Expand Up @@ -235,7 +236,7 @@ paths:
tags:
- Closet
summary: 브랜드 조회 로직
operationId: closet
operationId: getBrand
parameters:
- name: name
in: query
Expand Down Expand Up @@ -294,7 +295,7 @@ paths:
tags:
- Closet
summary: 브랜드 등록 로직
operationId: closet
operationId: addBrand
requestBody:
required: true
content:
Expand Down Expand Up @@ -377,7 +378,7 @@ paths:
tags:
- Closet
summary: 옷 직접 등록 로직
operationId: closet
operationId: addCloth
security:
- bearerAuth: []
requestBody:
Expand Down Expand Up @@ -527,7 +528,7 @@ paths:
tags:
- Closet
summary: 옷 이미지 업로드
operationId: closet
operationId: addClothImg
security:
- bearerAuth: []
requestBody:
Expand Down Expand Up @@ -605,6 +606,7 @@ paths:
tags:
- Closet
summary: 내 옷 수정 로직
operationId: putCloth
security:
- bearerAuth: []
parameters:
Expand Down Expand Up @@ -755,6 +757,7 @@ paths:
tags:
- Closet
summary: 내 옷 삭제 로직
operationId: delCloth
security:
- bearerAuth: []
parameters:
Expand Down

0 comments on commit d4ae5eb

Please sign in to comment.