Skip to content

Commit

Permalink
Fix saving custom fields on senses and examples (#1376)
Browse files Browse the repository at this point in the history
We were treating every field as an object, but the senses and example
fields are actually arrays of objects.
  • Loading branch information
rmunn authored Apr 4, 2022
1 parent 3741d3e commit 52e9fa7
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,9 @@ export class LexiconEditorController implements angular.IController {
}

private prepCustomFieldsForUpdate(data: any): any {
if (Array.isArray(data)) {
return data.map(item => this.prepCustomFieldsForUpdate(item));
}
data.customFields = {};
for (const fieldName in data) {
if (data.hasOwnProperty(fieldName)) {
Expand Down

0 comments on commit 52e9fa7

Please sign in to comment.