slicing dashboard

This commit is contained in:
2024-07-15 21:39:12 +07:00
parent 4c2d40986e
commit 751c36209e
20 changed files with 221 additions and 133 deletions

View File

@@ -71,7 +71,7 @@ export class DeviceService {
deviceSwitch(data): Observable<any> {
const endpoint = `/devices`;
const url = `${BASE_URL}${endpoint}/device-switch`;
const url = `${BASE_URL}${endpoint}/device-command`;
const headers = new HttpHeaders({
"Content-Type": "application/json",
"x-api-key": "j2yaYvPSQcsEEmHh3NEobfiXyyXmmnHT",

View File

@@ -1,6 +1,6 @@
import { Injectable } from "@angular/core";
import { HttpClient, HttpHeaders } from "@angular/common/http";
import { Observable } from "rxjs";
import { BehaviorSubject, Observable } from "rxjs";
import { jwtDecode } from "jwt-decode";
import { Router } from "@angular/router";
import { AuthService } from "src/app/_services/auth.service";
@@ -23,12 +23,17 @@ interface CustomJwtPayload {
})
export class LoginService {
private readonly tokenKey = "currentUser";
private tabSelected = new BehaviorSubject(null);
public _tabSelected = this.tabSelected.asObservable();
constructor(
private http: HttpClient,
private router: Router,
public logoutService: AuthService
) {}
setTabsSelected(e: string){
this.tabSelected.next(e);
}
updatePassword(data: any): Observable<any> {
const endpoint = `/users`;
const url = `${BASE_URL}${endpoint}/reset-password`;