Fix: Can't remove all profile fields

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2022-11-25 15:22:05 +01:00
parent 6456737d8a
commit 1fa85d0dd6

View file

@ -198,7 +198,10 @@ const EditProfile: React.FC = () => {
const handleSubmit: React.FormEventHandler = (event) => { const handleSubmit: React.FormEventHandler = (event) => {
const promises = []; 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) { if (features.muteStrangers) {
promises.push( promises.push(