mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +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);
|
operationValue = this.prepareAuthorityValue(value);
|
||||||
} else if (value instanceof FormFieldLanguageValueObject) {
|
} else if (value instanceof FormFieldLanguageValueObject) {
|
||||||
operationValue = new FormFieldMetadataValueObject(value.value, value.language);
|
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')) {
|
} else if (value.hasOwnProperty('value')) {
|
||||||
operationValue = new FormFieldMetadataValueObject(value.value);
|
operationValue = new FormFieldMetadataValueObject(value.value);
|
||||||
} else {
|
} else {
|
||||||
@@ -149,8 +151,8 @@ export class JsonPatchOperationsBuilder {
|
|||||||
return operationValue;
|
return operationValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected prepareAuthorityValue(value: any) {
|
protected prepareAuthorityValue(value: any): FormFieldMetadataValueObject {
|
||||||
let operationValue: any = null;
|
let operationValue: FormFieldMetadataValueObject;
|
||||||
if (isNotEmpty(value.authority)) {
|
if (isNotEmpty(value.authority)) {
|
||||||
operationValue = new FormFieldMetadataValueObject(value.value, value.language, value.authority);
|
operationValue = new FormFieldMetadataValueObject(value.value, value.language, value.authority);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user