refactor: move web http client to a new file

This commit is contained in:
Jovan Krunić
2018-12-14 10:52:52 +01:00
parent 83a2c85e05
commit 246dddd5a5
5 changed files with 79 additions and 62 deletions

View File

@@ -18,7 +18,7 @@ import {Client} from '@openstapps/api/lib/client';
import {SCThing} from '@openstapps/core';
import {Subject} from 'rxjs';
import {debounceTime, distinctUntilChanged} from 'rxjs/operators';
import {StAppsWebHttpClient} from '../data.provider';
import {StAppsWebHttpClient} from '../stapps-web-http-client.provider';
@Component({
selector: 'stapps-data-list',
@@ -39,14 +39,14 @@ export class DataListComponent {
loading: HTMLIonLoadingElement;
constructor(private loadingController: LoadingController,
private alertController: AlertController,
swHttpClient: StAppsWebHttpClient) {
private alertController: AlertController,
swHttpClient: StAppsWebHttpClient) {
this.client = new Client(swHttpClient, 'https://stappsbe01.innocampus.tu-berlin.de', '1.0.6');
this.queryChanged
.pipe(
debounceTime(1000),
distinctUntilChanged())
debounceTime(1000),
distinctUntilChanged())
.subscribe((model) => {
this.from = 0;
this.query = model;