File

src/app/modules/org-management/services/org-management/org-management.service.ts

Description

This service is used to manage bulk upload of users data or organization data. This service is also used to check status of uploaded file

Index

Properties
Methods

Constructor

constructor(configService: ConfigService, learnerService: LearnerService)

for making upload api calls

Parameters :
Name Type Optional
configService ConfigService No
learnerService LearnerService No

Methods

Public bulkOrgUpload
bulkOrgUpload(req)

This method is used to call upload api to upload organizations file

Parameters :
Name Optional
req No
getBulkUploadStatus
getBulkUploadStatus(processId)

This method is used to call status api to get the status of uploaded file

Parameters :
Name Optional
processId No
Returns : any

Properties

Public configService
Type : ConfigService

reference of config service.

Public learnerService
Type : LearnerService

reference of learner service.

import { Injectable } from '@angular/core';
import { ConfigService, RequestParam, ServerResponse } from '@sunbird/shared';
import { LearnerService } from '@sunbird/core';
import { Observable } from 'rxjs';
  /**
 * This service is used to manage bulk upload of users data or organization data.
 * This service is also used to check status of uploaded file
 */
@Injectable()
export class OrgManagementService {
  /**
 * reference of config service.
 */
  public configService: ConfigService;
  /**
* reference of learner service.
*/
  public learnerService: LearnerService;
  /**
* for making upload api calls
* @param {RequestParam} requestParam interface
*/
  constructor(configService: ConfigService, learnerService: LearnerService) {
    this.learnerService = learnerService;
    this.configService = configService;
  }
    /**
 * This method is used to call upload api to upload organizations file
 */
  public bulkOrgUpload(req): Observable<ServerResponse> {
    const httpOptions: RequestParam = {
      url: this.configService.urlConFig.URLS.ADMIN.BULK.ORGANIZATIONS_UPLOAD,
      data: req
    };
    return this.learnerService.post(httpOptions);
  }
      /**
 * This method is used to call status api to get the status of uploaded file
 */
  getBulkUploadStatus(processId) {
    const options = {
      url: this.configService.urlConFig.URLS.ADMIN.BULK.STATUS + '/' + processId
    };
    return this.learnerService.get(options);
  }
}

results matching ""

    No results matching ""