Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/_apis/gathering/gathering-apis.tsx

This file was deleted.

12 changes: 12 additions & 0 deletions src/_apis/my-gathering/hosted-gathering-list-apis.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { fetchApi } from '@/src/utils/api';
import { GatheringCardProps } from '@/src/types/gathering-data';

export function getHostedGatheringList(startDate: string): Promise<GatheringCardProps[]> {
const url = `/api/gatherings/hosted?startDate=${startDate}`;
return fetchApi<{ data: GatheringCardProps[] }>(url, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
}).then((response) => response.data);
}
Comment on lines +4 to +12
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

API κ΅¬ν˜„μ— λŒ€ν•œ κ°œμ„  μ œμ•ˆ

λ‹€μŒ 사항듀을 κ³ λ €ν•΄ μ£Όμ‹œκΈ° λ°”λžλ‹ˆλ‹€:

  1. startDate λ§€κ°œλ³€μˆ˜μ— λŒ€ν•œ μœ νš¨μ„± 검사가 ν•„μš”ν•©λ‹ˆλ‹€
  2. URL νŒŒλΌλ―Έν„°μ˜ μ•ˆμ „ν•œ 인코딩이 ν•„μš”ν•©λ‹ˆλ‹€
  3. 였λ₯˜ 처리λ₯Ό λ³΄κ°•ν•˜λ©΄ μ’‹κ² μŠ΅λ‹ˆλ‹€

λ‹€μŒκ³Ό 같이 κ°œμ„ ν•΄ λ³΄μ‹œλŠ” 것을 μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

-export function getHostedGatheringList(startDate: string): Promise<GatheringCardProps[]> {
-  const url = `/api/gatherings/hosted?startDate=${startDate}`;
+export function getHostedGatheringList(startDate: string): Promise<GatheringCardProps[]> {
+  if (!startDate || !isValidDate(startDate)) {
+    throw new Error('μœ νš¨ν•˜μ§€ μ•Šμ€ λ‚ μ§œ ν˜•μ‹μž…λ‹ˆλ‹€');
+  }
+
+  const url = `/api/gatherings/hosted?startDate=${encodeURIComponent(startDate)}`;
+
   return fetchApi<{ data: GatheringCardProps[] }>(url, {
     method: 'GET',
     headers: {
       'Content-Type': 'application/json',
     },
-  }).then((response) => response.data);
+  })
+    .then((response) => response.data)
+    .catch((error) => {
+      console.error('λͺ¨μž„ λͺ©λ‘μ„ κ°€μ Έμ˜€λŠ” 쀑 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€:', error);
+      throw error;
+    });

μΆ”κ°€λ‘œ λ‚ μ§œ μœ νš¨μ„± 검사λ₯Ό μœ„ν•œ 헬퍼 ν•¨μˆ˜λ„ ν•„μš”ν•©λ‹ˆλ‹€:

function isValidDate(dateString: string): boolean {
  const date = new Date(dateString);
  return date instanceof Date && !isNaN(date.getTime());
}

12 changes: 12 additions & 0 deletions src/_apis/my-gathering/joined-gathering-list-apis.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { fetchApi } from '@/src/utils/api';
import { GatheringCardProps } from '@/src/types/gathering-data';

export function getJoinedGatheringList(startDate: string): Promise<GatheringCardProps[]> {
const url = `/api/gatherings/joined?startDate=${startDate}`;
return fetchApi<{ data: GatheringCardProps[] }>(url, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
}).then((response) => response.data);
}
Comment on lines +4 to +12
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

API κ΅¬ν˜„μ— λŒ€ν•œ λͺ‡ κ°€μ§€ κ°œμ„ μ‚¬ν•­μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

λ‹€μŒ 사항듀을 κ³ λ €ν•΄μ£Όμ‹œκΈ° λ°”λžλ‹ˆλ‹€:

  1. startDate νŒŒλΌλ―Έν„°μ— λŒ€ν•œ μœ νš¨μ„± 검사가 ν•„μš”ν•©λ‹ˆλ‹€.
  2. μ—λŸ¬ 처리 둜직이 λˆ„λ½λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.
  3. URL νŒŒλΌλ―Έν„° ꡬ성 μ‹œ 인코딩이 ν•„μš”ν•©λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 κ°œμ„ ν•˜λŠ” 것을 μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

 export function getJoinedGatheringList(startDate: string): Promise<GatheringCardProps[]> {
+  if (!startDate || !/^\d{4}-\d{2}-\d{2}$/.test(startDate)) {
+    throw new Error('μœ νš¨ν•˜μ§€ μ•Šμ€ λ‚ μ§œ ν˜•μ‹μž…λ‹ˆλ‹€.');
+  }
-  const url = `/api/gatherings/joined?startDate=${startDate}`;
+  const url = `/api/gatherings/joined?startDate=${encodeURIComponent(startDate)}`;
   return fetchApi<{ data: GatheringCardProps[] }>(url, {
     method: 'GET',
     headers: {
       'Content-Type': 'application/json',
     },
-  }).then((response) => response.data);
+  }).then((response) => response.data)
+    .catch((error) => {
+      console.error('λͺ¨μž„ λͺ©λ‘μ„ κ°€μ Έμ˜€λŠ”λ° μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€:', error);
+      throw error;
+    });
 }

μΆ”κ°€λ‘œ, 응닡 νƒ€μž…μ˜ μ•ˆμ „μ„±μ„ μœ„ν•΄ zodλ‚˜ λ‹€λ₯Έ λŸ°νƒ€μž„ νƒ€μž… 검증 λ„κ΅¬μ˜ μ‚¬μš©μ„ κ³ λ €ν•΄λ³΄μ‹œκΈ° λ°”λžλ‹ˆλ‹€.

πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export function getJoinedGatheringList(startDate: string): Promise<GatheringCardProps[]> {
const url = `/api/gatherings/joined?startDate=${startDate}`;
return fetchApi<{ data: GatheringCardProps[] }>(url, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
}).then((response) => response.data);
}
export function getJoinedGatheringList(startDate: string): Promise<GatheringCardProps[]> {
if (!startDate || !/^\d{4}-\d{2}-\d{2}$/.test(startDate)) {
throw new Error('μœ νš¨ν•˜μ§€ μ•Šμ€ λ‚ μ§œ ν˜•μ‹μž…λ‹ˆλ‹€.');
}
const url = `/api/gatherings/joined?startDate=${encodeURIComponent(startDate)}`;
return fetchApi<{ data: GatheringCardProps[] }>(url, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
}).then((response) => response.data)
.catch((error) => {
console.error('λͺ¨μž„ λͺ©λ‘μ„ κ°€μ Έμ˜€λŠ”λ° μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€:', error);
throw error;
});
}

11 changes: 0 additions & 11 deletions src/_queries/gathering/gathering-queries.tsx

This file was deleted.

10 changes: 10 additions & 0 deletions src/_queries/my-gathering/hosted-gathering-list-queries.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { getHostedGatheringList } from '@/src/_apis/my-gathering/hosted-gathering-list-apis';
import { GatheringCardProps } from '@/src/types/gathering-data';

export function useGetHostedGatheringListQuery(startDate: string) {
return {
queryKey: ['gatheringDetail', startDate],
queryFn: () => getHostedGatheringList(startDate),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

μ—λŸ¬ 처리 둜직 μΆ”κ°€λ₯Ό κ²€ν† ν•΄μ£Όμ„Έμš”.

API 호좜 μ‹€νŒ¨ μ‹œμ˜ μ—λŸ¬ μ²˜λ¦¬κ°€ λˆ„λ½λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. queryFnμ—μ„œ μ—λŸ¬λ₯Ό 적절히 μ²˜λ¦¬ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

-    queryFn: () => getHostedGatheringList(startDate),
+    queryFn: async () => {
+      try {
+        return await getHostedGatheringList(startDate);
+      } catch (error) {
+        console.error('λͺ¨μž„ λͺ©λ‘μ„ λΆˆλŸ¬μ˜€λŠ”λ° μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€:', error);
+        throw new Error('λͺ¨μž„ λͺ©λ‘μ„ λΆˆλŸ¬μ˜€λŠ”λ° μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€.');
+      }
+    },
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
queryFn: () => getHostedGatheringList(startDate),
queryFn: async () => {
try {
return await getHostedGatheringList(startDate);
} catch (error) {
console.error('λͺ¨μž„ λͺ©λ‘μ„ λΆˆλŸ¬μ˜€λŠ”λ° μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€:', error);
throw new Error('λͺ¨μž„ λͺ©λ‘μ„ λΆˆλŸ¬μ˜€λŠ”λ° μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€.');
}
},

select: (data: GatheringCardProps[]) => data,
};
}
10 changes: 10 additions & 0 deletions src/_queries/my-gathering/joined-gathering-list-queries.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { getJoinedGatheringList } from '@/src/_apis/my-gathering/joined-gathering-list-apis';
import { GatheringCardProps } from '@/src/types/gathering-data';

export function useGetJoinedGatheringListQuery(startDate: string) {
return {
queryKey: ['gatheringDetail', startDate],
queryFn: () => getJoinedGatheringList(startDate),
select: (data: GatheringCardProps[]) => data,
};
}
Comment on lines +4 to +10
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

μ—λŸ¬ 처리 및 νƒ€μž… μ•ˆμ „μ„± κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

  1. μ—λŸ¬ 처리 섀정이 λˆ„λ½λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.
  2. API 응닡 νƒ€μž…μ΄ λͺ…μ‹œμ μœΌλ‘œ μ •μ˜λ˜μ–΄ μžˆμ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
  3. select ν•¨μˆ˜κ°€ 데이터λ₯Ό κ·ΈλŒ€λ‘œ λ°˜ν™˜ν•˜λ―€λ‘œ λΆˆν•„μš”ν•©λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 κ°œμ„ ν•΄λ³΄μ„Έμš”:

-export function useGetJoinedGatheringListQuery(startDate: string) {
+export function useGetJoinedGatheringListQuery(startDate: string) {
+  type ApiResponse = GatheringCardProps[];
+
   return {
-    queryKey: ['gatheringDetail', startDate],
+    queryKey: ['joinedGatheringList', startDate],
-    queryFn: () => getJoinedGatheringList(startDate),
+    queryFn: async (): Promise<ApiResponse> => {
+      try {
+        return await getJoinedGatheringList(startDate);
+      } catch (error) {
+        throw new Error(`λͺ¨μž„ λͺ©λ‘μ„ κ°€μ Έμ˜€λŠ”λ° μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€: ${error}`);
+      }
+    },
     retry: 1,
     staleTime: 5 * 60 * 1000, // 5λΆ„
-    select: (data: GatheringCardProps[]) => data,
   };
 }
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export function useGetJoinedGatheringListQuery(startDate: string) {
return {
queryKey: ['gatheringDetail', startDate],
queryFn: () => getJoinedGatheringList(startDate),
select: (data: GatheringCardProps[]) => data,
};
}
export function useGetJoinedGatheringListQuery(startDate: string) {
type ApiResponse = GatheringCardProps[];
return {
queryKey: ['joinedGatheringList', startDate],
queryFn: async (): Promise<ApiResponse> => {
try {
return await getJoinedGatheringList(startDate);
} catch (error) {
throw new Error(`λͺ¨μž„ λͺ©λ‘μ„ κ°€μ Έμ˜€λŠ”λ° μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€: ${error}`);
}
},
retry: 1,
staleTime: 5 * 60 * 1000, // 5λΆ„
};
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { useMemo } from 'react';
import { formatDate } from '@/src/utils/format-date';
import { formatDate, getDayOfWeek } from '@/src/utils/format-date';
import ScheduledGatheringCard from '@/src/components/common/gathering-card/scheduled-gathering-card/container';
import { GatheringCardProps } from '@/src/types/gathering-data';

Expand All @@ -27,7 +27,9 @@ export default function GatheringListWithDate({ gatheringList }: GatheringListWi
{gathering.isNewDate && (
<div className="hidden flex-nowrap md:block">
<div className="text-lg font-semibold">{formatDate(gathering.dateTime).date}</div>
<div className="text-base font-medium text-gray-500">μ›”μš”μΌ</div>
<div className="text-base font-medium text-gray-500">
{getDayOfWeek(gathering.dateTime)}
</div>
</div>
)}
</div>
Expand Down
78 changes: 0 additions & 78 deletions src/app/(crew)/my-gathering/creation/page.tsx

This file was deleted.

35 changes: 35 additions & 0 deletions src/app/(crew)/my-gathering/hosted/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
'use client';

import { useEffect, useState } from 'react';
import { useQuery } from '@tanstack/react-query';
import { useGetHostedGatheringListQuery } from '@/src/_queries/my-gathering/hosted-gathering-list-queries';
import { formatDateToRequest } from '@/src/utils/format-date';
import GatheringListWithDate from '@/src/app/(crew)/my-gathering/_component/gathering-list-with-date';
import PopOverCalendar from '@/src/components/common/input/pop-over-calendar';
import { GatheringCardProps } from '@/src/types/gathering-data';

export default function MyGatheringHostedPage() {
const [selectedDate, setSelectedDate] = useState(new Date());
const [hostedGatheringList, setHostedGatheringList] = useState<GatheringCardProps[]>();

const { data, refetch } = useQuery(
useGetHostedGatheringListQuery(formatDateToRequest(selectedDate)),
);

useEffect(() => {
setHostedGatheringList(data);
}, [data]);

useEffect(() => {
refetch();
}, [selectedDate]);

Comment on lines +15 to +26
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

쿼리 및 μ΄νŽ™νŠΈ μ΅œμ ν™”κ°€ ν•„μš”ν•©λ‹ˆλ‹€

  1. 데이터 μ—…λ°μ΄νŠΈ 둜직 κ°œμ„ :
  • setHostedGatheringList(data)λ₯Ό μ‹€ν–‰ν•˜λŠ” 첫 번째 useEffectλŠ” λΆˆν•„μš”ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
  • dataλ₯Ό 직접 λ Œλ”λ§μ— μ‚¬μš©ν•˜λŠ” 것이 더 효율적일 수 μžˆμŠ΅λ‹ˆλ‹€.
  1. μ—λŸ¬ 처리 μΆ”κ°€:
  • 쿼리 μ‹€νŒ¨ μ‹œμ˜ μ—λŸ¬ μ²˜λ¦¬κ°€ μ—†μŠ΅λ‹ˆλ‹€.
  • λ‘œλ”© μƒνƒœ μ²˜λ¦¬λ„ ν•„μš”ν•©λ‹ˆλ‹€.
- const { data, refetch } = useQuery(
+ const { data, error, isLoading, refetch } = useQuery(
    useGetHostedGatheringListQuery(formatDateToRequest(selectedDate)),
  );

- useEffect(() => {
-   setHostedGatheringList(data);
- }, [data]);

  useEffect(() => {
    refetch();
  }, [selectedDate]);

λ Œλ”λ§ 뢀뢄도 λ‹€μŒκ³Ό 같이 μˆ˜μ •μ΄ ν•„μš”ν•©λ‹ˆλ‹€:

  return (
    <div>
      <div className="py-4 md:py-6">
        <PopOverCalendar value={selectedDate} onChange={(d) => setSelectedDate(d)} />
      </div>
+     {isLoading && <div>λ‘œλ”© 쀑...</div>}
+     {error && <div>데이터λ₯Ό λΆˆλŸ¬μ˜€λŠ”λ° μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€</div>}
-     {hostedGatheringList && <GatheringListWithDate gatheringList={hostedGatheringList} />}
+     {data && <GatheringListWithDate gatheringList={data} />}
    </div>
  );

Committable suggestion skipped: line range outside the PR's diff.

return (
<div>
<div className="py-4 md:py-6">
<PopOverCalendar value={selectedDate} onChange={(d) => setSelectedDate(d)} />
</div>
{hostedGatheringList && <GatheringListWithDate gatheringList={hostedGatheringList} />}
</div>
);
}
35 changes: 35 additions & 0 deletions src/app/(crew)/my-gathering/joined/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
'use client';

import { useEffect, useState } from 'react';
import { useQuery } from '@tanstack/react-query';
import { useGetJoinedGatheringListQuery } from '@/src/_queries/my-gathering/joined-gathering-list-queries';
import { formatDateToRequest } from '@/src/utils/format-date';
import GatheringListWithDate from '@/src/app/(crew)/my-gathering/_component/gathering-list-with-date';
import PopOverCalendar from '@/src/components/common/input/pop-over-calendar';
import { GatheringCardProps } from '@/src/types/gathering-data';

export default function MyGatheringJoinedPage() {
const [selectedDate, setSelectedDate] = useState(new Date());
const [joinedGatheringList, setJoinedGatheringList] = useState<GatheringCardProps[]>();

Comment on lines +11 to +14
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

μ—λŸ¬ μƒνƒœ 처리 μΆ”κ°€ ν•„μš”

데이터 λ‘œλ”© 및 μ—λŸ¬ μƒνƒœλ₯Ό μ²˜λ¦¬ν•˜κΈ° μœ„ν•œ μƒνƒœ λ³€μˆ˜λ₯Ό μΆ”κ°€ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 μƒνƒœλ₯Ό μΆ”κ°€ν•˜λŠ” 것을 μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

  const [selectedDate, setSelectedDate] = useState(new Date());
  const [joinedGatheringList, setJoinedGatheringList] = useState<GatheringCardProps[]>();
+ const [error, setError] = useState<Error | null>(null);
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export default function MyGatheringJoinedPage() {
const [selectedDate, setSelectedDate] = useState(new Date());
const [joinedGatheringList, setJoinedGatheringList] = useState<GatheringCardProps[]>();
export default function MyGatheringJoinedPage() {
const [selectedDate, setSelectedDate] = useState(new Date());
const [joinedGatheringList, setJoinedGatheringList] = useState<GatheringCardProps[]>();
const [error, setError] = useState<Error | null>(null);

const { data, refetch } = useQuery(
useGetJoinedGatheringListQuery(formatDateToRequest(selectedDate)),
);
Comment on lines +15 to +17
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

useQuery ν›… μ΅œμ ν™” ν•„μš”

ν˜„μž¬ κ΅¬ν˜„μ—μ„œ μ€‘μš”ν•œ useQuery κΈ°λŠ₯듀이 λˆ„λ½λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 κ°œμ„ ν•˜λŠ” 것을 μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

- const { data, refetch } = useQuery(
+ const { data, error, isLoading, refetch } = useQuery(
    useGetJoinedGatheringListQuery(formatDateToRequest(selectedDate)),
+   {
+     retry: 1,
+     onError: (error) => setError(error),
+     staleTime: 5 * 60 * 1000, // 5λΆ„
+   }
  );

Committable suggestion skipped: line range outside the PR's diff.


useEffect(() => {
setJoinedGatheringList(data);
}, [data]);

useEffect(() => {
refetch();
}, [selectedDate]);

return (
<div>
<div className="py-4 md:py-6">
<PopOverCalendar value={selectedDate} onChange={(d) => setSelectedDate(d)} />
</div>
{joinedGatheringList && <GatheringListWithDate gatheringList={joinedGatheringList} />}
</div>
);
}
Comment on lines +27 to +35
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

UI μƒνƒœ 처리 및 μ ‘κ·Όμ„± κ°œμ„  ν•„μš”

λ‘œλ”© μƒνƒœ, μ—λŸ¬ μƒνƒœ ν‘œμ‹œ 및 μ ‘κ·Όμ„± 속성이 λˆ„λ½λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같은 κ°œμ„ μ„ μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

  return (
-   <div>
+   <div role="main" aria-label="μ°Έμ—¬ν•œ λͺ¨μž„ λͺ©λ‘">
      <div className="py-4 md:py-6">
        <PopOverCalendar value={selectedDate} onChange={(d) => setSelectedDate(d)} />
      </div>
+     {isLoading && <div>λ‘œλ”© 쀑...</div>}
+     {error && <div role="alert">데이터λ₯Ό λΆˆλŸ¬μ˜€λŠ” 쀑 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€: {error.message}</div>}
-     {joinedGatheringList && <GatheringListWithDate gatheringList={joinedGatheringList} />}
+     {!isLoading && !error && data && <GatheringListWithDate gatheringList={data} />}
    </div>
  );

Committable suggestion skipped: line range outside the PR's diff.

4 changes: 2 additions & 2 deletions src/app/(crew)/my-gathering/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { usePathname, useRouter } from 'next/navigation';
import Tabs from '@/src/components/common/tab';

const myGatheringTabs = [
{ id: 'my-gathering-participation', label: 'μ°Έμ—¬ν•œ 약속', route: '/my-gathering/participation' },
{ id: 'my-gathering-creation', label: 'λ§Œλ“  약속', route: '/my-gathering/creation' },
{ id: 'my-gathering-joined', label: 'μ°Έμ—¬ν•œ 약속', route: '/my-gathering/joined' },
{ id: 'my-gathering-hosted', label: 'λ§Œλ“  약속', route: '/my-gathering/hosted' },
];

export default function MyGatheringLayout({
Expand Down
2 changes: 1 addition & 1 deletion src/app/(crew)/my-gathering/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { redirect } from 'next/navigation';

export default function MyGatheringPage() {
redirect('/my-gathering/participation');
redirect('/my-gathering/joined');
return null;
}
65 changes: 0 additions & 65 deletions src/app/(crew)/my-gathering/participation/page.tsx

This file was deleted.

Loading