[WIP] Switched from rest to GraphQL #162-2
This commit is contained in:
@@ -3,13 +3,15 @@ import { FormBuilder, FormControl, FormGroup } from "@angular/forms";
|
||||
import { Router } from "@angular/router";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
import { LazyLoadEvent } from "primeng/api";
|
||||
import { debounceTime } from "rxjs";
|
||||
import { debounceTime, throwError } from "rxjs";
|
||||
import { ConfirmationDialogService } from "src/app/services/confirmation-dialog/confirmation-dialog.service";
|
||||
import { DataService } from "src/app/services/data/data.service";
|
||||
import { ServerService } from "src/app/services/data/server.service";
|
||||
import { SpinnerService } from "src/app/services/spinner/spinner.service";
|
||||
import { ToastService } from "src/app/services/toast/toast.service";
|
||||
import { Server } from "../../../../../models/data/server.model";
|
||||
import { catchError } from "rxjs/operators";
|
||||
import { Queries } from "../../../../../models/graphql/queries.model";
|
||||
|
||||
@Component({
|
||||
selector: 'app-dashboard',
|
||||
@@ -71,14 +73,14 @@ export class DashboardComponent implements OnInit {
|
||||
|
||||
async loadNextPage() {
|
||||
this.spinnerService.showSpinner();
|
||||
// this.data.getFilteredServers(this.searchCriterions).pipe(catchError(err => {
|
||||
// this.spinnerService.hideSpinner();
|
||||
// return throwError(() => err);
|
||||
// })).subscribe(list => {
|
||||
// this.totalRecords = list.totalCount;
|
||||
// this.servers = list.servers;
|
||||
// this.spinnerService.hideSpinner();
|
||||
// });
|
||||
this.data.query(Queries.serverInfoQuery).pipe(catchError(err => {
|
||||
this.spinnerService.hideSpinner();
|
||||
return throwError(() => err);
|
||||
})).subscribe(data => {
|
||||
this.totalRecords = data.data.serverCount;
|
||||
this.servers = data.data.servers;
|
||||
this.spinnerService.hideSpinner();
|
||||
});
|
||||
}
|
||||
|
||||
nextPage(event: LazyLoadEvent) {
|
||||
|
Reference in New Issue
Block a user