mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
add show total users in rocket chat server
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from "rxjs"
|
||||
import { AuthService } from './auth.service';
|
||||
import { HttpService } from './http.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { HttpClient, HttpHeaderResponse } from '@angular/common/http';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ChatService {
|
||||
headers: HttpHeaders;
|
||||
options:any;
|
||||
|
||||
|
||||
constructor(
|
||||
private http:HttpClient,
|
||||
private httpService: HttpService,
|
||||
private authService: AuthService,
|
||||
private storageService:StorageService,) {
|
||||
this.headers = new HttpHeaders();
|
||||
this.authService.userData$.subscribe((res:any)=>{
|
||||
this.headers = this.headers.set('X-User-Id', res.userId);
|
||||
this.headers = this.headers.set('X-Auth-Token', res.authToken);
|
||||
});
|
||||
}
|
||||
|
||||
getAllUsers(){
|
||||
this.options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
console.log(this.headers);
|
||||
|
||||
return this.http.get(environment.apiChatUrl+'users.list', this.options);
|
||||
}
|
||||
getPrivateGroups(){
|
||||
this.http.get(environment.apiChatUrl+'groups.list', this.options);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user