feat: add Master Admin application functionality
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable, inject, signal } from '@angular/core';
|
||||
import { Observable, tap } from 'rxjs';
|
||||
import { TenantContext } from '../../models/context/context.model';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class TenantContextService {
|
||||
private readonly http = inject(HttpClient);
|
||||
readonly tenantContext = signal<TenantContext | null>(null);
|
||||
|
||||
loadTenantContext(): Observable<TenantContext> {
|
||||
return this.http.get<TenantContext>(``).pipe(
|
||||
tap((context) => {
|
||||
this.tenantContext.set(context);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
clear(): void {
|
||||
this.tenantContext.set(null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user