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
2 changes: 1 addition & 1 deletion src/api/workspace/api-end-point.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const WORKSPACE_API_END_POINTS = {
RECENT_DOCUMENTS: (workspaceId: string) => `workspaces/${workspaceId}/sidebar`,
WORKSPACE_EDIT: (workspaceId: string) => `workspaces/${workspaceId}`,
SEARCH_DOCUMENTS: (workspaceId: string) => `workspaces/${workspaceId}`,
CALENDAR: (workspaceId: number | null) => `workspaces/${workspaceId}/calendar`,
CALENDAR: (workspaceId: string | null) => `workspaces/${workspaceId}/calendar`,
RECENT_BOXED_FILES: (workspaceId: string) => `workspaces/${workspaceId}/recent`,
MY_WORKSPACE: '/workspaces/me',
} as const;
2 changes: 1 addition & 1 deletion src/api/workspace/api.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export type FetchMyWorkspacesResponseDto = WorkspaceSummary[];
export type UpdateWorkspaceResponseDto = WorkspaceDetail;

export interface fetchCalendarResquestDto {
workspaceId: number;
workspaceId: string;
start: Date;
end: Date;
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/workspace/get/queries/useFetchCalendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { fetchCalendar } from '../apis/fetchCalendar';
/**
* 캘린더에서 워크 스페이스의 캘린더 조회의 파일을 가져오는 훅
*/
const useFetchCalendar = (workspaceId: number, start: Date, end: Date) => {
const useFetchCalendar = (workspaceId: string, start: Date, end: Date) => {
// Hydrate된 데이터가 있어 추가 네트워크 요청 없이 바로 캐시 데이터 사용
return useAfterQuery<
{ result: { documentList: DocumentList[] } }, // TData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const CalendarPage = async ({ params }: workspaceIdTypes) => {
const { workspaceId } = await params;
return (
<div className="mt-36pxr">
<CalendarSection workspaceId={Number(workspaceId)} />;
<CalendarSection workspaceId={workspaceId} />;
</div>
);
};
Expand Down
6 changes: 1 addition & 5 deletions src/app/workspace/[workspaceId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ const InnerWorkspaceIdPage = () => {

<div className="mt-74pxr mb-92pxr flex flex-col">
<div className="mb-20pxr text-t3-bd">내 캘린더</div>
{isRecentLoading ? (
<CalendarSkeleton />
) : (
<CalendarSection workspaceId={Number(workspaceId)} />
)}
{isRecentLoading ? <CalendarSkeleton /> : <CalendarSection workspaceId={workspaceId} />}
</div>
</div>
</GnbLeftLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { CalendarSectionProps } from './CalendarSection.types';

const CalendarSection = ({ workspaceId }: CalendarSectionProps) => {
const router = useRouter();
if (!workspaceId || Number.isNaN(workspaceId)) {
if (!workspaceId) {
router.replace(ROUTES.NOT_FOUND);
}
const { currentDate, setCurrentDate } = useCalendarStore();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export interface CalendarSectionProps {
workspaceId: number;
workspaceId: string;
}
2 changes: 1 addition & 1 deletion src/common/constants/query-key.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const queryKeys = createQueryKeyStore({
recentDocuments: (workspaceId: string) => [workspaceId, 'recentDocuments'],
search: (workspaceId: string, title: string) => [workspaceId, 'search', title],
recentBoxedFiles: (workspaceId: string) => [workspaceId, 'recentBoxedFiles'],
calendar: (workspaceId: number, start: Date, end: Date) => [
calendar: (workspaceId: string, start: Date, end: Date) => [
workspaceId,
'calendar',
start,
Expand Down