add show total users in rocket chat server

This commit is contained in:
Tiago Kayaya
2020-10-30 15:22:35 +01:00
parent 4a7df21759
commit 21eb3d3cf1
63 changed files with 970 additions and 139 deletions
+41
View File
@@ -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);
}
}