diff --git a/src/apis/hangout.ts b/src/apis/hangout.ts index 51ccd78..e0374d3 100644 --- a/src/apis/hangout.ts +++ b/src/apis/hangout.ts @@ -35,7 +35,7 @@ export const api_getHangouts = getApi('GET', '/api/hangout', { members: { id: number; email: string; - nickname: string; + name: string; profileImg: string; status: string; }[]; diff --git a/src/apis/hangoutDetail.ts b/src/apis/hangoutDetail.ts new file mode 100644 index 0000000..dadfece --- /dev/null +++ b/src/apis/hangoutDetail.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { getApi } from '@/utils/api'; + +const BASE_QUERY_KEY = ['hangout']; + +// TODO type +/** 약속 상세 정보를 조회하는 API */ +export const api_getHangoutDetail = getApi('GET', '/api/hangout', { + needToLogin: true, + requestSchema: z.object({ + pathParams: z.tuple([z.number().describe('hangout id')]), + }), + getQueryKey: (requestInput?) => + requestInput + ? [...BASE_QUERY_KEY, 'single', requestInput.pathParams[0]] + : [...BASE_QUERY_KEY, 'single'], + _resultType: {} as any, +}); diff --git a/src/components/common/HangoutBox/HangoutBox.stories.tsx b/src/components/common/HangoutBox/HangoutBox.stories.tsx index 629ce1e..c72974d 100644 --- a/src/components/common/HangoutBox/HangoutBox.stories.tsx +++ b/src/components/common/HangoutBox/HangoutBox.stories.tsx @@ -15,10 +15,12 @@ export const Default: Story = { location: '숭실대 정보관 204호', members: [ { + id: 1, name: '공소나', profileImg: 'https://img.freepik.com/free-icon/user_318-159711.jpg', }, { + id: 2, name: '공소나2', profileImg: 'https://img.freepik.com/free-icon/user_318-159711.jpg', }, @@ -33,10 +35,12 @@ export const HangoutBoxWithShadow: Story = { location: '숭실대 정보관 204호', members: [ { + id: 1, name: '공소나', profileImg: 'https://img.freepik.com/free-icon/user_318-159711.jpg', }, { + id: 2, name: '공소나2', profileImg: 'https://img.freepik.com/free-icon/user_318-159711.jpg', }, @@ -52,10 +56,12 @@ export const NotAcceptedHangoutBox: Story = { location: '숭실대 정보관 204호', members: [ { + id: 1, name: '공소나', profileImg: 'https://img.freepik.com/free-icon/user_318-159711.jpg', }, { + id: 2, name: '공소나2', profileImg: 'https://img.freepik.com/free-icon/user_318-159711.jpg', }, diff --git a/src/components/common/HangoutBox/HangoutBox.tsx b/src/components/common/HangoutBox/HangoutBox.tsx index 83e99e6..648dbdb 100644 --- a/src/components/common/HangoutBox/HangoutBox.tsx +++ b/src/components/common/HangoutBox/HangoutBox.tsx @@ -60,8 +60,8 @@ const HangoutBox = ({