Merge pull request #4350 from MaximilianKrambach/minorTodos

fix baseFilter for comments
This commit is contained in:
Emanuel Schütze 2019-02-15 14:15:18 +01:00 committed by GitHub
commit 2b471bac2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ import { BehaviorSubject, Observable } from 'rxjs';
import { BaseModel } from '../../shared/models/base/base-model';
import { BaseViewModel } from '../../site/base/base-view-model';
import { StorageService } from '../core-services/storage.service';
import { BaseRepository } from '../repositories/base-repository';
/**
* Describes the available filters for a listView.
@ -103,9 +104,7 @@ export abstract class BaseFilterListService<M extends BaseModel, V extends BaseV
/**
* Constructor.
*/
public constructor(private store: StorageService, private repo: any) {
// repo( extends BaseRepository<V, M> ) { // TODO
}
public constructor(private store: StorageService, private repo: BaseRepository<V, M>) {}
/**
* Initializes the filterService. Returns the filtered data as Observable
@ -316,7 +315,7 @@ export abstract class BaseFilterListService<M extends BaseModel, V extends BaseV
const compareValueCondition = (value, condition): boolean => {
if (value === condition) {
return true;
} else if ('id' in value && value.id === condition) {
} else if (typeof value === 'object' && 'id' in value && value.id === condition) {
return true;
}
return false;