Skip to content

Commit

Permalink
fix: swrを関数内に記載
Browse files Browse the repository at this point in the history
  • Loading branch information
naohanpen committed Aug 14, 2024
1 parent 718d09b commit 33254bf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/app/committee/forms/[form_id]/FormDetailedView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ const FileViewInstance: React.FC<{ fileId: string }> = ({ fileId }) => {
return <FileView name={file.name} link={file.url} />;
};

const { data, isLoading: isLoading_user } = useSWR("/users/me");
const me = assignType("/users/me", data);

export const FormDetailedView: React.FC<{ form: components["schemas"]["Form"] }> = ({ form }) => {
const {
register,
Expand All @@ -50,6 +47,8 @@ export const FormDetailedView: React.FC<{ form: components["schemas"]["Form"] }>
const { data, isLoading, error } = useSWR(`/form-answers?form_id=${form.id}`);
const answers = assignType("/form-answers", data);
const { user } = useAuthState();
const { data: data_user, isLoading: isLoading_user } = useSWR("/users/me");
const me = assignType("/users/me", data_user);
if (isLoading) return;
if (error) return `エラーが発生しました${error}`;

Expand Down

0 comments on commit 33254bf

Please sign in to comment.