From aea5cc102143f478b334ce97137fc28783ef5362 Mon Sep 17 00:00:00 2001 From: suhwan2004 Date: Mon, 4 Nov 2024 00:16:16 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=ED=94=BC=EB=93=9C=20=EC=88=98=EC=A0=95?= =?UTF-8?q?,=20=EC=9E=91=EC=84=B1=20Request=20DTO=EB=A5=BC=20entities/feed?= =?UTF-8?q?/model/types.ts=20=EC=97=90=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/mocks/handlers/feed.ts | 19 +++---------------- src/entities/feed/model/index.ts | 2 +- src/entities/feed/model/{type.ts => types.ts} | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 17 deletions(-) rename src/entities/feed/model/{type.ts => types.ts} (57%) diff --git a/src/app/mocks/handlers/feed.ts b/src/app/mocks/handlers/feed.ts index 11c6b23..60a3b1d 100644 --- a/src/app/mocks/handlers/feed.ts +++ b/src/app/mocks/handlers/feed.ts @@ -1,29 +1,16 @@ import { http } from 'msw'; -import { feedMockData } from '../data'; +import { IReportFeedReqDTO, IWriteFeedReqDTO } from '@/entities/feed'; + import { feedMockData } from '../data'; import { createHttpErrorResponse, createHttpSuccessResponse } from '../lib'; -interface IReportFeedReqDTO { - category: string; - content: string; - isBlind: boolean; -} - -interface IWriteFeedReqDTO { - content: string; - images: string[]; - scope: TFeedScope; -} - -type TFeedScope = 'public' | 'friends' | 'private'; - export const feedHandlers = [ // 1️⃣ 피드 신고 http.post('http://api.example.com/v2/feeds/:feedId/reports', async ({ request, params }) => { const { feedId } = params; - const { category, content } = (await request.json()) as IReportFeedReqDTO; + const { category, isBlind } = (await request.json()) as IReportFeedReqDTO; if (!feedId || !category) { return createHttpErrorResponse('피드 ID, 신고 카테고리가 필수로 입력되어야 합니다.'); diff --git a/src/entities/feed/model/index.ts b/src/entities/feed/model/index.ts index b38ebc9..fcb073f 100644 --- a/src/entities/feed/model/index.ts +++ b/src/entities/feed/model/index.ts @@ -1 +1 @@ -export * from './type'; +export * from './types'; diff --git a/src/entities/feed/model/type.ts b/src/entities/feed/model/types.ts similarity index 57% rename from src/entities/feed/model/type.ts rename to src/entities/feed/model/types.ts index de05bf8..2346291 100644 --- a/src/entities/feed/model/type.ts +++ b/src/entities/feed/model/types.ts @@ -18,3 +18,17 @@ export interface IFeed { createdAt: string; updatedAt: string; } + +export interface IReportFeedReqDTO { + category: string; + content: string; + isBlind: boolean; +} + +export interface IWriteFeedReqDTO { + content: string; + images: string[]; + scope: TFeedScope; +} + +export type TFeedScope = 'public' | 'friends' | 'private';