diff --git a/frontend/app/components/Client/CustomFields/CustomFieldForm.tsx b/frontend/app/components/Client/CustomFields/CustomFieldForm.tsx index dd76542c9..2b95055fa 100644 --- a/frontend/app/components/Client/CustomFields/CustomFieldForm.tsx +++ b/frontend/app/components/Client/CustomFields/CustomFieldForm.tsx @@ -44,9 +44,11 @@ const CustomFieldForm: React.FC = ({ siteId }) => { } else { toast.error(response.errors[0]); } + }).catch(() => { + toast.error('An error occurred while saving metadata.'); }).finally(() => { setLoading(false); - }); + }) }; return ( diff --git a/frontend/app/services/CustomFieldService.ts b/frontend/app/services/CustomFieldService.ts index 1b85e92ba..a87fe83e5 100644 --- a/frontend/app/services/CustomFieldService.ts +++ b/frontend/app/services/CustomFieldService.ts @@ -18,7 +18,7 @@ export default class CustomFieldService extends BaseService { } async update(projectId: string, instance: any): Promise { - return this.client.put(`/${projectId}/metadata/${instance.index}`, instance) + return this.client.post(`/${projectId}/metadata/${instance.index}`, instance) .then(r => r.json()).then(j => j.data); }