From 1fa85d0dd6b7ce891a843c7e434f223642c880dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Fri, 25 Nov 2022 15:22:05 +0100 Subject: [PATCH] Fix: Can't remove all profile fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/features/edit-profile/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/soapbox/features/edit-profile/index.tsx b/app/soapbox/features/edit-profile/index.tsx index 1967e9138..6a96079a5 100644 --- a/app/soapbox/features/edit-profile/index.tsx +++ b/app/soapbox/features/edit-profile/index.tsx @@ -198,7 +198,10 @@ const EditProfile: React.FC = () => { const handleSubmit: React.FormEventHandler = (event) => { const promises = []; - promises.push(dispatch(patchMe(data, true))); + const params = { ...data }; + if (params.fields_attributes?.length === 0) params.fields_attributes = [{ name: '', value: '' }]; + + promises.push(dispatch(patchMe(params, true))); if (features.muteStrangers) { promises.push(