Skip to content

Commit

Permalink
Don't query on server
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Feb 4, 2024
1 parent 007e5d4 commit b46f59a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions projects/budgetkey/src/app/item/budgetkey-item.service.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { Injectable} from '@angular/core';
import { HttpClient } from '@angular/common/http';

import { Observable } from 'rxjs';
import { Observable, from } from 'rxjs';
import { map } from 'rxjs/operators';
import { Item } from './model';
import { Format } from '../format';
import { GlobalSettingsService } from '../common-components/global-settings.service';
import { PlatformService } from '../common-components/platform.service';

@Injectable()
export class BudgetKeyItemService {
format = new Format();
constructor(private http: HttpClient, private globalSettings: GlobalSettingsService) {}
constructor(private http: HttpClient, private globalSettings: GlobalSettingsService, private ps: PlatformService) {}

getRedashUrl(query: string): string {
// TODO: Implement
Expand Down Expand Up @@ -96,6 +97,9 @@ export class BudgetKeyItemService {
}

getItemData(query: string, headersOrder: string[], formatters: any[], page = 0, pageSize?: number): Observable<object> {
if (this.ps.server()) {
return from([{query, headers: [], items: [], total: 0, rows: [], error: null, pages: 0, page: 0}])
}
const params: any = {
page
};
Expand Down

0 comments on commit b46f59a

Please sign in to comment.