diff --git a/src/apis/dashboards/queries.ts b/src/apis/dashboards/queries.ts
index abe1bc9..8a87748 100644
--- a/src/apis/dashboards/queries.ts
+++ b/src/apis/dashboards/queries.ts
@@ -19,8 +19,9 @@ export const useDashboardQuery = (id: Dashboard['id']) => {
};
export const useDashboardInvitationsQuery = (params: GetDashboardInvitationsRequest) => {
+ const { id, ...rest } = params;
return useQuery({
- queryKey: ['invitations', params.id],
+ queryKey: ['invitations', id, rest],
queryFn: () => getDashboardInvitations(params),
});
};
diff --git a/src/app/(after-login)/dashboard/[id]/error.tsx b/src/app/(after-login)/dashboard/[id]/error.tsx
new file mode 100644
index 0000000..11ae156
--- /dev/null
+++ b/src/app/(after-login)/dashboard/[id]/error.tsx
@@ -0,0 +1,18 @@
+'use client';
+
+import { Page, PageInner } from '@/components/layout/Page';
+import GoBackLink from '@/components/ui/Link/GoBackLink';
+
+export default function Error() {
+ return (
+
+
+
+
+
+ 문제가 생겼습니다.
+ 문제가 생겼습니다. 관리자에게 문의해주세요
+
+
+ );
+}
diff --git a/src/app/(after-login)/dashboard/page.tsx b/src/app/(after-login)/dashboard/page.tsx
deleted file mode 100644
index f009b2a..0000000
--- a/src/app/(after-login)/dashboard/page.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function page() {
- return
대시시보드 페이지
;
-}
diff --git a/src/app/(after-login)/form/page.tsx b/src/app/(after-login)/form/page.tsx
deleted file mode 100644
index a4df8cb..0000000
--- a/src/app/(after-login)/form/page.tsx
+++ /dev/null
@@ -1,161 +0,0 @@
-'use client';
-
-import { zodResolver } from '@hookform/resolvers/zod';
-import { Controller, useForm } from 'react-hook-form';
-import { z } from 'zod';
-import Button from '@/components/ui/Button/Button';
-import { Input, Textarea, TagInput, DateInput, ImageUpload, SearchInput } from '@/components/ui/Field';
-
-/**
- * Input, Textarea, SearchInput 컴포넌트는 controlled, uncontrolled 둘다 사용하실 수 있습니다.
- * TagInput, DateInput, ImageUpload는 controlled로만 작동합니다.
- *
- * controlled 컴포넌트를 RHF(React Hook Form)에 연결하는 샘플은
- * 아래 코드에서 확인하시면 됩니다.
- * (RHF의 Controller의 render함수에서 제공하는 field(value, onChange, onBlur)를
- * 내부 컴포넌트에게 전달해서 작동을 하는 원리입니다.)
- *
- *
- * 커스텀 컴포넌트를 제외한 대부분의 컴포넌트는 기본적으로 input attributes를 확장하여 제공하도록 작성하여
- * 기본 input의 속성들을 전달하실 수 있습니다. (placeholder, required, disabled, readonly....)
- */
-
-const sampleSchema = z.object({
- title: z.string().min(2, { message: '최소 두글자 이상 작성해주세요' }),
- content: z.string().min(2, { message: '최소 두글자 이상 작성해주세요' }),
- date: z.date({ message: '날짜를 입력해주세요' }),
- tags: z.array(z.string()).min(1, { message: '태그를 한개 이상 입력해주세요.' }),
- keyword: z.string(),
- image: z
- .union([
- z
- .instanceof(File)
- .refine((file) => file.type.startsWith('image/'), { message: '이미지 파일만 업로드 가능합니다.' })
- .refine((file) => file.size < 2 * 1024 * 1024, { message: '2MB이하로 올려주세요' }),
- z.string(),
- ])
- .optional(),
- // 파일업로드를 필수로 하려면 optional을 지우고 아래 refine을 붙여주시면됩니다.
- // .refine((value) => value instanceof File || (typeof value === 'string' && value.length > 0), { message: '파일을 업로드해주세요' }),
-});
-
-type SampleFormType = z.infer;
-
-export default function FormPage() {
- const {
- register,
- control,
- handleSubmit,
- formState: { errors },
- } = useForm({
- resolver: zodResolver(sampleSchema),
- mode: 'onBlur',
- defaultValues: {
- title: '제목',
- content: '내용내용 테스트세트슽',
- date: undefined,
- tags: [],
- keyword: '',
- image: undefined,
- },
- });
-
- const onSubmit = (formData: SampleFormType) => {
- console.log(formData);
- };
-
- return (
-
-
-
- {/* input sample : controlled */}
- {
- console.log(e.target.value);
- }}
- readOnly
- />
-
-
-
-
- );
-}
diff --git a/src/components/dashboard/InviteDashboard.tsx b/src/components/dashboard/InviteDashboard.tsx
index b6785b3..77190bf 100644
--- a/src/components/dashboard/InviteDashboard.tsx
+++ b/src/components/dashboard/InviteDashboard.tsx
@@ -38,6 +38,7 @@ const InviteDashboard = forwardRef((props, ref) => {
try {
await invite({ id: Number(id), email: formData.email });
alert('초대했습니다.');
+ reset();
if (ref && 'current' in ref) {
ref.current?.close();
}
diff --git a/src/components/dashboard/MyInvitedDashboardList.tsx b/src/components/dashboard/MyInvitedDashboardList.tsx
index fc601aa..b7dce0c 100644
--- a/src/components/dashboard/MyInvitedDashboardList.tsx
+++ b/src/components/dashboard/MyInvitedDashboardList.tsx
@@ -56,7 +56,7 @@ export default function MyInvitedDashboardList() {
{hasNoSearchResults ? (
검색된 초대가 없습니다.
) : (
- <>
+
@@ -91,8 +91,8 @@ export default function MyInvitedDashboardList() {
{/* 공통 load more 트리거 요소 */}
-
- >
+
+
)}
)}