ui update, init to consumer statistics and manage pos user types
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { EntityState, EntityStore } from '@/core/state';
|
||||
import { computed, inject, Injectable } from '@angular/core';
|
||||
import { MenuItem } from 'primeng/api';
|
||||
import { catchError, finalize, throwError } from 'rxjs';
|
||||
import { catchError, finalize } from 'rxjs';
|
||||
import { consumerBusinessActivityNamedRoutes } from '../constants';
|
||||
import { IBusinessActivityResponse } from '../models';
|
||||
import { BusinessActivitiesService } from '../services/main.service';
|
||||
@@ -55,11 +55,9 @@ export class BusinessActivityStore extends EntityStore<
|
||||
finalize(() => {
|
||||
this.patchState({ loading: false });
|
||||
}),
|
||||
catchError(() => {
|
||||
this.patchState({
|
||||
error: '',
|
||||
});
|
||||
return throwError('');
|
||||
catchError((error) => {
|
||||
this.setError(error);
|
||||
throw error;
|
||||
}),
|
||||
)
|
||||
.subscribe((entity) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { EntityState, EntityStore } from '@/core/state';
|
||||
import { computed, inject, Injectable } from '@angular/core';
|
||||
import { MenuItem } from 'primeng/api';
|
||||
import { catchError, finalize, throwError } from 'rxjs';
|
||||
import { catchError, finalize } from 'rxjs';
|
||||
import { consumerComplexesNamedRoutes } from '../constants/routes/complexes';
|
||||
import { IComplexResponse } from '../models';
|
||||
import { ConsumerComplexesService } from '../services/complexes.service';
|
||||
@@ -50,11 +50,9 @@ export class ConsumerComplexStore extends EntityStore<IComplexResponse, ComplexS
|
||||
finalize(() => {
|
||||
this.patchState({ loading: false });
|
||||
}),
|
||||
catchError(() => {
|
||||
this.patchState({
|
||||
error: '',
|
||||
});
|
||||
return throwError('');
|
||||
catchError((error) => {
|
||||
this.setError(error);
|
||||
throw error;
|
||||
}),
|
||||
)
|
||||
.subscribe((entity) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { EntityState, EntityStore } from '@/core/state';
|
||||
import { computed, inject, Injectable } from '@angular/core';
|
||||
import { MenuItem } from 'primeng/api';
|
||||
import { catchError, finalize, throwError } from 'rxjs';
|
||||
import { catchError, finalize } from 'rxjs';
|
||||
import { consumerPosesNamedRoutes } from '../constants/routes/poses';
|
||||
import { IPosResponse } from '../models';
|
||||
import { ConsumerPosesService } from '../services/poses.service';
|
||||
@@ -51,11 +51,9 @@ export class PosStore extends EntityStore<IPosResponse, PosState> {
|
||||
finalize(() => {
|
||||
this.patchState({ loading: false });
|
||||
}),
|
||||
catchError(() => {
|
||||
this.patchState({
|
||||
error: '',
|
||||
});
|
||||
return throwError('');
|
||||
catchError((error) => {
|
||||
this.setError(error);
|
||||
throw error;
|
||||
}),
|
||||
)
|
||||
.subscribe((entity) => {
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Component, computed, effect, inject, signal } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { CookieService } from 'ngx-cookie-service';
|
||||
import { Button } from 'primeng/button';
|
||||
import { COOKIE_KEYS } from 'src/assets/constants';
|
||||
import { ConsumerPosFormComponent } from '../../components/poses/form.component';
|
||||
import { ConsumerSalesInvoicesComponent } from '../../components/salesInvoices/list.component';
|
||||
import { BusinessActivityStore } from '../../store/businessActivity.store';
|
||||
@@ -53,8 +54,8 @@ export class SuperAdminUserPosComponent {
|
||||
}
|
||||
|
||||
toPosLanding() {
|
||||
// this.cookieService.delete('posId', '/', 'localhost', false, 'Lax');
|
||||
this.cookieService.set('posId', this.posId(), {
|
||||
this.cookieService.set(COOKIE_KEYS.POS_ID, '', new Date());
|
||||
this.cookieService.set(COOKIE_KEYS.POS_ID, this.posId(), {
|
||||
sameSite: 'Lax', // or 'Strict' for same-site requests only
|
||||
secure: false,
|
||||
path: '/',
|
||||
|
||||
Reference in New Issue
Block a user