From d923ccc83398417168cc0ba611092ed7fe879c0f Mon Sep 17 00:00:00 2001
From: LeeWxx <dnckd0903@naver.com>
Date: Sun, 8 Dec 2024 00:55:02 +0900
Subject: [PATCH] =?UTF-8?q?fix:=20=EC=A1=B0=ED=95=A9=20api=20=EB=B0=98?=
 =?UTF-8?q?=ED=99=98=EA=B0=92=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20=ED=86=B5?=
 =?UTF-8?q?=EC=9D=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/repositories/partRepository.js | 3 ++-
 src/services/partService.js        | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/repositories/partRepository.js b/src/repositories/partRepository.js
index feb5c6d..658b94a 100644
--- a/src/repositories/partRepository.js
+++ b/src/repositories/partRepository.js
@@ -34,7 +34,7 @@ const PartRepository = {
     const query = `
     SELECT DISTINCT p.${column}
     FROM relations r
-    JOIN part_info_${type} p ON r.part_id = p.part_id -- id 대신 part_id 사용
+    JOIN part_info_${type} p ON r.part_id = p.part_id
     WHERE p.${column} IS NOT NULL
     ORDER BY p.${column}
   `;
@@ -67,6 +67,7 @@ const PartRepository = {
   `;
 
     const result = await pool.query(query);
+    
     return result.rows;
   },
 
diff --git a/src/services/partService.js b/src/services/partService.js
index e85f690..1053ecb 100644
--- a/src/services/partService.js
+++ b/src/services/partService.js
@@ -77,7 +77,9 @@ const PartService = {
 
   async getCombinations() {
     const allCombinations = await PartRepository.getAllCombinations();
-    return allCombinations;
+    return allCombinations.map((combination) => ({
+      partIds: combination.partids,
+    }));;
   },
 
   async getFilteredCombinations(filters) {
-- 
GitLab