restore exception validation logic with proper operator
This commit is contained in:
parent
7dae80e73a
commit
40fbc1d223
@ -24,8 +24,10 @@ function canEdit(key: string, allowDerived: boolean = false) {
|
|||||||
|
|
||||||
export function validateFieldChange(field: string, value: any, isExternal: boolean = true) {
|
export function validateFieldChange(field: string, value: any, isExternal: boolean = true) {
|
||||||
if(!isDefined(field)) {
|
if(!isDefined(field)) {
|
||||||
|
if(field !== 'is_extension'){
|
||||||
throw new InvalidFieldError('Field does not exist', field);
|
throw new InvalidFieldError('Field does not exist', field);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const allowDerived = !isExternal;
|
const allowDerived = !isExternal;
|
||||||
if(!canEdit(field, allowDerived)) {
|
if(!canEdit(field, allowDerived)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user