fix: autosave with nested localized fields

This commit is contained in:
James
2022-12-16 17:14:00 -05:00
parent 0fbfe149df
commit 4202fc2933

View File

@@ -90,7 +90,7 @@ const Autosave: React.FC<Props> = ({ collection, global, id, publishedDocUpdated
if (url) {
const body = {
...reduceFieldsToValues(fieldRef.current),
...reduceFieldsToValues(fieldRef.current, true),
_status: 'draft',
};
@@ -102,7 +102,9 @@ const Autosave: React.FC<Props> = ({ collection, global, id, publishedDocUpdated
'Content-Type': 'application/json',
'Accept-Language': i18n.language,
},
body: JSON.stringify(body),
body: JSON.stringify({
_payload: JSON.stringify(body),
}),
});
setSaving(false);