Skip to content

Commit

Permalink
fix: form
Browse files Browse the repository at this point in the history
  • Loading branch information
WhatACotton committed Apr 22, 2024
1 parent 373e4a5 commit 69f50c1
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions src/common_components/form_answer/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,31 +70,36 @@ export const Form = ({ form, answerId, answerItems, editable }: Props) => {
toast.error(`申請の修正に失敗しました`);
return;
}
client
.PUT("/form-answers/{form_answer_id}", {
params: {
path: {
form_answer_id: answerId,
toast.promise(
client
.PUT("/form-answers/{form_answer_id}", {
params: {
path: {
form_answer_id: answerId,
},
},
},
body: {
form_id: form.id,
items: items,
},
})
.then(async ({ error }) => {
if (error) {
toast.error(`申請の修正に失敗しました`);
body: {
form_id: form.id,
items: items,
},
})
.then(async ({ error }) => {
if (error) {
await deleteAllUploadedFiles(fileIds);
throw new Error(error.message);
}
window.location.reload();
})
.catch(async () => {
await deleteAllUploadedFiles(fileIds);
return;
}
toast.success("申請の修正に成功しました");
window.location.reload();
})
.catch(async () => {
toast.error(`申請の修正内容の送信中にエラーが発生しました`);
await deleteAllUploadedFiles(fileIds);
});
throw new Error(`申請の修正に失敗しました`);
}),
{
loading: "申請の修正中",
success: "申請の修正に成功しました",
error: "申請の修正に失敗しました",
},
);
} else {
client
.POST("/form-answers", {
Expand Down

0 comments on commit 69f50c1

Please sign in to comment.