From 6a7c53bfadee2e433d15adf38870fa9c3f67397a Mon Sep 17 00:00:00 2001 From: Hyein Jeong Date: Thu, 21 Nov 2024 18:28:16 +0900 Subject: [PATCH] =?UTF-8?q?[BE][Feat]=20#230=20:=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=EC=9E=90=EB=B3=84=20=EC=B1=84=EB=84=90=20get=20api=20response?= =?UTF-8?q?=20=ED=83=80=EC=9E=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/controllers/channelController.js | 2 +- backend/swaggerConfig.js | 21 ++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/backend/src/controllers/channelController.js b/backend/src/controllers/channelController.js index 7dbf16ff..5a6ac842 100644 --- a/backend/src/controllers/channelController.js +++ b/backend/src/controllers/channelController.js @@ -117,7 +117,7 @@ export const getUserChannelsController = async (req, res) => { res.status(200).json({ success: true, message: 'Get channels successfully', - data: channels, + data: { channels }, }); } catch (error) { console.error(error); diff --git a/backend/swaggerConfig.js b/backend/swaggerConfig.js index ec6ed9ad..e48fcde3 100644 --- a/backend/swaggerConfig.js +++ b/backend/swaggerConfig.js @@ -437,15 +437,20 @@ const swaggerDefinition = { // 사용자별 채널 가져오기 응답 스키마 GetUserChannelsResponse: { - type: 'array', - items: { - type: 'object', - properties: { - id: { type: 'string' }, - name: { type: 'string' }, - generated_at: { type: 'string', format: 'date-time' }, + type: 'object', + properties: { + channels: { + type: 'array', + items: { + type: 'object', + properties: { + id: { type: 'string' }, + name: { type: 'string' }, + generated_at: { type: 'string', format: 'date-time' }, + }, + required: ['id', 'name', 'generated_at'], + }, }, - required: ['id', 'name', 'generated_at'], }, }, },