1 import { Injectable } from '@angular/core';
2 import { RdpCrudInterface } from 'portalsdk-tag-lib';
3 import { AdminService } from '../admin.service';
4 import { BehaviorSubject } from 'rxjs';
9 export class RoleFunctionsService implements RdpCrudInterface {
11 public statusResponse = new BehaviorSubject("");
12 public updatedData = new BehaviorSubject<any>({});
14 loadTableData(filter: any, sortActive: any, sortDirection: any, pageIndex: any, pageSize: any): import("rxjs").Observable<any[]> {
15 throw new Error("Method not implemented.");
18 throw new Error("Method not implemented.");
21 constructor(private adminService: AdminService) { }
24 console.log("Add method is getting called from RoleFunctionService data:: ", data);
28 update(data: any): any {
29 console.log("Update method is getting called from RoleFunctionService data:: ", data);
30 return this.adminService.saveRoleFunction(data).subscribe(response => {
31 console.log("Success Response ", response);
32 this.statusResponse.next("200");
34 console.log("Error ", error);
39 console.log("Delete method is getting called from RoleFunctionService data::>> " + JSON.stringify(data));
40 this.adminService.deleteRoleFunction(data).subscribe(response => {
41 console.log("Repsonse : ", response);
42 this.statusResponse.next("200");
48 let response = this.adminService.getRoleFunctionList();
50 response.subscribe(res => {
52 let data = JSON.parse(JSON.parse(editedData.data).availableRoleFunctions);
53 console.log("Get Method called : ", data);
54 this.updatedData.next(data);