/** Angular Imports */ import { Injectable } from '@angular/core' ; import { HttpClient , HttpParams } from '@angular/common/http' ; /** rxjs Imports */ import { Observable } from 'rxjs' ; /**
 * Users service.
 */ @ Injectable ( { providedIn : 'root' } ) export class UsersService { param { HttpClient } http constructor ( private http ) { } returns { Observable < any > } getUsers ( ) { return this . http . get ( '/users' ) ; } returns { Observable < any > } getUsersTemplate ( ) { return this . http . get ( '/users/template' ) ; } param { any } user returns { Observable < any > } createUser ( user ) { return this . http . post ( '/users' , user ) ; } param { string } userId param { any } user returns { Observable < any > } editUser ( userId , user ) { return this . http . put ( `/users/${ userId }` , user ) ; } param { string } userId returns { Observable < any > } getUser ( userId ) { return this . http . get ( `/users/${ userId }` ) ; } param userId param password returns { Observable < any > } changePassword ( userId , passwordObj ) { return this . http . put ( `/users/${ userId }` , passwordObj ) ; } param { string } userId returns { Observable < any > } deleteUser ( userId ) { return this . http . delete ( `/users/${ userId }` ) ; } param { any } officeId returns { Observable < any > } getStaff ( officeId ) { const httpParams = new HttpParams ( ) . set ( 'officeId' , officeId . toString ( ) ) . set ( 'status' , 'all' ) ; return this . http . get ( '/staff' , { params : httpParams } ) ; } }