|
@@ -2,7 +2,7 @@ import { isObject, get } from 'lodash'
|
|
|
import { Observable, Subject, interval, map, of } from 'rxjs'
|
|
|
import { DataPrepService } from './dataprep.service'
|
|
|
import _ = require("lodash")
|
|
|
-import { Conditions, DateRange, Storage } from '../types/interface'
|
|
|
+import { Conditions, DateRange, ObservableStorage, Storage, StorageLocation } from '../types/interface'
|
|
|
export class SearchService {
|
|
|
|
|
|
private dataPrepService: DataPrepService
|
|
@@ -25,12 +25,16 @@ export class SearchService {
|
|
|
let filteredResult: Subject<any> = new Subject()
|
|
|
|
|
|
if (storage.type == 'observable') {
|
|
|
- let obsRef = storage.ref
|
|
|
+ // ObservableStorage
|
|
|
+ let currentStorage:ObservableStorage = storage;
|
|
|
+ let obsRef = currentStorage.ref
|
|
|
obsRef.subscribe((element) => {
|
|
|
dataFromStorage.next(element)
|
|
|
})
|
|
|
} else {
|
|
|
- this.dataPrepService.loadObsData(storage, dataFromStorage)
|
|
|
+ // StorageLocation
|
|
|
+ let currentStorage:StorageLocation = storage;
|
|
|
+ this.dataPrepService.loadObsData(currentStorage, dataFromStorage)
|
|
|
}
|
|
|
|
|
|
this.filterFromObs(dataFromStorage, filteredResult, ...conditions)
|