fix baseFilter for comments
This commit is contained in:
parent
edd22eeef6
commit
af0e85a956
@ -4,6 +4,7 @@ import { BehaviorSubject, Observable } from 'rxjs';
|
|||||||
import { BaseModel } from '../../shared/models/base/base-model';
|
import { BaseModel } from '../../shared/models/base/base-model';
|
||||||
import { BaseViewModel } from '../../site/base/base-view-model';
|
import { BaseViewModel } from '../../site/base/base-view-model';
|
||||||
import { StorageService } from '../core-services/storage.service';
|
import { StorageService } from '../core-services/storage.service';
|
||||||
|
import { BaseRepository } from '../repositories/base-repository';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes the available filters for a listView.
|
* Describes the available filters for a listView.
|
||||||
@ -103,9 +104,7 @@ export abstract class BaseFilterListService<M extends BaseModel, V extends BaseV
|
|||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
public constructor(private store: StorageService, private repo: any) {
|
public constructor(private store: StorageService, private repo: BaseRepository<V, M>) {}
|
||||||
// repo( extends BaseRepository<V, M> ) { // TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the filterService. Returns the filtered data as Observable
|
* 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 => {
|
const compareValueCondition = (value, condition): boolean => {
|
||||||
if (value === condition) {
|
if (value === condition) {
|
||||||
return true;
|
return true;
|
||||||
} else if ('id' in value && value.id === condition) {
|
} else if (typeof value === 'object' && 'id' in value && value.id === condition) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user