Merge pull request #4317 from MaximilianKrambach/fixcat

fix category filter
This commit is contained in:
Sean 2019-02-12 13:28:11 +01:00 committed by GitHub
commit f3452d8904
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -316,7 +316,7 @@ export abstract class BaseFilterListService<M extends BaseModel, V extends BaseV
const compareValueCondition = (value, condition): boolean => {
if (value === condition) {
return true;
} else if (value.hasOwnProperty('id') && value.id === condition) {
} else if ('id' in value && value.id === condition) {
return true;
}
return false;
@ -341,7 +341,7 @@ export abstract class BaseFilterListService<M extends BaseModel, V extends BaseV
) {
return true;
}
} else if (typeof item[filter.property] === 'object' && item[filter.property].hasOwnProperty('id')) {
} else if (typeof item[filter.property] === 'object' && 'id' in item[filter.property]) {
if (item[filter.property].id === option.condition) {
return true;
}