mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Fixed issue with preparing patch operation's value when value has an authority id but is not an instance of VocabularyEntry or FormFieldMetadataValueObject
This commit is contained in:
@@ -134,6 +134,8 @@ export class JsonPatchOperationsBuilder {
|
||||
operationValue = this.prepareAuthorityValue(value);
|
||||
} else if (value instanceof FormFieldLanguageValueObject) {
|
||||
operationValue = new FormFieldMetadataValueObject(value.value, value.language);
|
||||
} else if (value.hasOwnProperty('authority')) {
|
||||
operationValue = new FormFieldMetadataValueObject(value.value, value.language, value.authority);
|
||||
} else if (value.hasOwnProperty('value')) {
|
||||
operationValue = new FormFieldMetadataValueObject(value.value);
|
||||
} else {
|
||||
@@ -149,8 +151,8 @@ export class JsonPatchOperationsBuilder {
|
||||
return operationValue;
|
||||
}
|
||||
|
||||
protected prepareAuthorityValue(value: any) {
|
||||
let operationValue: any = null;
|
||||
protected prepareAuthorityValue(value: any): FormFieldMetadataValueObject {
|
||||
let operationValue: FormFieldMetadataValueObject;
|
||||
if (isNotEmpty(value.authority)) {
|
||||
operationValue = new FormFieldMetadataValueObject(value.value, value.language, value.authority);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user