summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/ext/profile/profile.service.ts
blob: 1c631347c80e119f8315560968cb22b056054b0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { environment } from 'src/environments/environment';

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

  constructor(private http:HttpClient) { }

  getUserPagination(){
    return this.http.get(environment.getUserPagination);         
  }

  getAllUsers(){
    return this.http.get(environment.getAllUsers);         
  }

  getPostSearch(postSearchBean:any)
  {
    return this.http.post(environment.postSearch,JSON.stringify({postSearchBean: postSearchBean}));

  }

  importUser(postSearchBean:any)
  {
    return this.http.post(environment.importSearch,JSON.stringify({postSearchBean: postSearchBean}));

  }

  getPostProfile()
  {
    return this.http.get(environment.getPostProfile);         

  }

  getSelfProfile()
  {
    return this.http.get(environment.getSelfProfile);         

  }

  getProfileById(profileId){
    return this.http.get(environment.getProfileById+"?profile_id="+profileId);
  }

  removeRole(data,profileId)
  {
    return this.http.post(environment.removeUserRole+'?profile_id='+profileId,JSON.stringify({role: data}));
  }

  addUserRole(data,profileId)
  {
    return this.http.post(environment.addUserRole+'?profile_id='+profileId,JSON.stringify({role: data}));
  }
  
  saveProfile(data,profileId)
  {
    return this.http.post(environment.saveProfile+'?profile_id='+profileId,JSON.stringify({profile: data.profile,selectedCountry:data.selectedCountry, selectedState:data.selectedState, selectedTimeZone:data.selectedTimeZone}));

  }

  toggleProfileActive(profileId){
   return this.http.get(environment.toggleProfileActive+profileId);  
  }
  

}