- {MOCK_DATA_PARTICIPANTS.map((ele, idx) => (
-
{ele}
+
+ {applicants?.map((ele, idx) => (
+
))}
diff --git a/src/hooks/queries/queryKeys.ts b/src/hooks/queries/queryKeys.ts
index a12ed06..948a213 100644
--- a/src/hooks/queries/queryKeys.ts
+++ b/src/hooks/queries/queryKeys.ts
@@ -26,6 +26,7 @@ export const queryKeys = {
MY_INVITE_CODE: () => ['myInviteCode'],
ADD_FRIENDSHIP: () => ['addFriendship'],
SHARE_DETAIL: () => ['shareDetail'],
+ SHARE_APPLICANTS: () => ['shareApplicants'],
} as const;
export type QueryKeys = (typeof queryKeys)[keyof typeof queryKeys];
diff --git a/src/hooks/queries/share/index.ts b/src/hooks/queries/share/index.ts
index 54400ea..705877b 100644
--- a/src/hooks/queries/share/index.ts
+++ b/src/hooks/queries/share/index.ts
@@ -1,2 +1,3 @@
export { default as useGetShares } from './useGetShares';
export { default as useGetShareDetail } from './useGetShareDetail';
+export { default as useGetShareApplicants } from './useGetShareApplicants';
diff --git a/src/hooks/queries/share/useGetShareApplicants.ts b/src/hooks/queries/share/useGetShareApplicants.ts
new file mode 100644
index 0000000..2dff63d
--- /dev/null
+++ b/src/hooks/queries/share/useGetShareApplicants.ts
@@ -0,0 +1,21 @@
+import type { ShareApplicantData } from '@/types/share';
+import { queryKeys } from '../queryKeys';
+import { useBaseQuery } from '../useBaseQuery';
+
+const useGetShareApplicants = ({
+ id,
+}: {
+ id: string | string[] | undefined;
+}) => {
+ if (typeof id !== 'string') {
+ return null;
+ }
+ const { data } = useBaseQuery(
+ queryKeys.SHARE_APPLICANTS(),
+ `/shares/${id}/applies`,
+ );
+
+ return data?.data;
+};
+
+export default useGetShareApplicants;
diff --git a/src/types/share/index.d.ts b/src/types/share/index.d.ts
index e0c410d..bfa6b77 100644
--- a/src/types/share/index.d.ts
+++ b/src/types/share/index.d.ts
@@ -18,3 +18,8 @@ interface ShareDetailData extends ShareData {
userName: string;
profileImage: ProfileEnum;
}
+
+interface ShareApplicantData {
+ nickname: string;
+ profileImage: ProfileEnum;
+}
From 5a2c27cd782fd64eb55b943f7ea3740ee7d34983 Mon Sep 17 00:00:00 2001
From: hyeseon han
Date: Sat, 24 Feb 2024 18:30:22 +0900
Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=EB=82=98=EB=88=94=20=EB=AA=A9?=
=?UTF-8?q?=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20API=20type=20=EC=88=98?=
=?UTF-8?q?=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/queries/share/useGetShares.ts | 4 +++-
src/pages/share/index.tsx | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/hooks/queries/share/useGetShares.ts b/src/hooks/queries/share/useGetShares.ts
index f6a55ed..fbcbb5a 100644
--- a/src/hooks/queries/share/useGetShares.ts
+++ b/src/hooks/queries/share/useGetShares.ts
@@ -1,4 +1,6 @@
-import { type ShareStatusType, type ShareSortType } from '@/types/friendship';
+import type { ShareSortType, ShareStatusType } from '@/types/friendship';
+
+import type { ShareData } from '@/types/share';
import { queryKeys } from '../queryKeys';
import { useBaseInfiniteQuery } from '../useBaseInfiniteQuery';
diff --git a/src/pages/share/index.tsx b/src/pages/share/index.tsx
index 252a67f..d4686d4 100644
--- a/src/pages/share/index.tsx
+++ b/src/pages/share/index.tsx
@@ -14,6 +14,7 @@ import Header from '@/components/organisms/Header';
import Link from 'next/link';
import type { NextPage } from 'next';
import { PlusIcon } from '@/assets/icons';
+import { type ShareData } from '@/types/share';
import ShareListItem from '@/components/organisms/ShareListItem';
import { SuspenseFallback } from '@/components/templates';
import { useGetShares } from '@/hooks/queries/share';