create consumer domain accounts permissions
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { EntityState, EntityStore } from '@/core/state';
|
||||
import { computed, inject, Injectable } from '@angular/core';
|
||||
import { CookieService } from 'ngx-cookie-service';
|
||||
import { catchError, finalize, throwError } from 'rxjs';
|
||||
import { finalize, map } from 'rxjs';
|
||||
import { IPosInfoResponse } from './models/pos.io';
|
||||
import { PosService } from './modules/landing/services/main.service';
|
||||
|
||||
@@ -30,22 +30,18 @@ export class PosStore extends EntityStore<IPosInfoResponse, PosState> {
|
||||
|
||||
getData() {
|
||||
this.patchState({ loading: true });
|
||||
this.service
|
||||
.getInfo()
|
||||
.pipe(
|
||||
finalize(() => {
|
||||
this.patchState({ loading: false });
|
||||
}),
|
||||
catchError(() => {
|
||||
this.patchState({
|
||||
error: '',
|
||||
});
|
||||
return throwError('');
|
||||
}),
|
||||
)
|
||||
.subscribe((entity) => {
|
||||
this.patchState({ entity });
|
||||
});
|
||||
return this.service.getInfo().pipe(
|
||||
finalize(() => {
|
||||
this.patchState({ loading: false });
|
||||
}),
|
||||
|
||||
map((entity: IPosInfoResponse) => {
|
||||
if (entity) {
|
||||
this.patchState({ entity: entity });
|
||||
}
|
||||
return entity;
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
override reset(): void {
|
||||
|
||||
Reference in New Issue
Block a user