diff --git a/src/repositories/partRepository.js b/src/repositories/partRepository.js index feb5c6dd84679282111044cce130744e186d65ff..658b94adc107d3c639c85645f23dd84d2f75d665 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 e85f690c5a73cf3beac90701b449752d9d789e0f..1053ecba48db50324733e801ca8dea19b20d48c3 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) {