File

src/app/modules/dashboard/services/dataset/dataset.service.ts

Index

Properties
Methods

Constructor

constructor(config: ConfigService, baseReportService: BaseReportService)
Parameters :
Name Type Optional
config ConfigService No
baseReportService BaseReportService No

Methods

Public getDataSet
getDataSet(undefined: literal type)
Parameters :
Name Type Optional
literal type No
Returns : any

Properties

Public config
Type : ConfigService
import { BaseReportService } from '@sunbird/core';
import { Injectable } from '@angular/core';
import { ConfigService } from '@sunbird/shared';
import { pluck } from 'rxjs/operators';

@Injectable({
  providedIn: 'root'
})
export class DatasetService {

  constructor(public config: ConfigService, private baseReportService: BaseReportService) {
  }

  public getDataSet({ datasetId, from, to, header = null }: {
    datasetId: string, from: string; to:
      string; header?: { [key: string]: string | string[] }
  }) {
    const req = {
      url: `${this.config.urlConFig.URLS.DATASET.READ}/${datasetId}?from=${from}&to=${to}`,
      ...(header && { header })
    };
    return this.baseReportService.get(req).pipe(pluck('result'));
  }
}

results matching ""

    No results matching ""