Skip to content

Commit 52e9fa7

Browse files
authored
Fix saving custom fields on senses and examples (#1376)
We were treating every field as an object, but the senses and example fields are actually arrays of objects.
1 parent 3741d3e commit 52e9fa7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/angular-app/languageforge/lexicon/editor/editor.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,9 @@ export class LexiconEditorController implements angular.IController {
11571157
}
11581158

11591159
private prepCustomFieldsForUpdate(data: any): any {
1160+
if (Array.isArray(data)) {
1161+
return data.map(item => this.prepCustomFieldsForUpdate(item));
1162+
}
11601163
data.customFields = {};
11611164
for (const fieldName in data) {
11621165
if (data.hasOwnProperty(fieldName)) {

0 commit comments

Comments
 (0)