ui update, init to consumer statistics and manage pos user types
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Maybe } from '@/core';
|
||||
import { IPaginatedResponse } from '@/core/models/service.model';
|
||||
import { IListingResponse, IPaginatedResponse } from '@/core/models/service.model';
|
||||
import { Component, signal } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { catchError, finalize, Observable } from 'rxjs';
|
||||
import { IColumn } from '../components/pageDataList/page-data-list.component';
|
||||
|
||||
@Component({
|
||||
@@ -28,10 +28,21 @@ export abstract class AbstractList<ResponseModel, RequestParams = null> {
|
||||
|
||||
getData() {
|
||||
this.loading.set(true);
|
||||
this.getDataRequest(this.requestPayload())?.subscribe((res) => {
|
||||
this.loading.set(false);
|
||||
this.items.set(res.data);
|
||||
});
|
||||
this.items.set([]);
|
||||
this.getDataRequest(this.requestPayload())
|
||||
?.pipe(
|
||||
finalize(() => {
|
||||
console.log('first');
|
||||
|
||||
this.loading.set(false);
|
||||
}),
|
||||
catchError((error) => {
|
||||
throw error;
|
||||
}),
|
||||
)
|
||||
.subscribe((res) => {
|
||||
this.items.set(res.data ?? []);
|
||||
});
|
||||
}
|
||||
|
||||
openAddForm() {
|
||||
@@ -42,7 +53,7 @@ export abstract class AbstractList<ResponseModel, RequestParams = null> {
|
||||
|
||||
abstract getDataRequest(
|
||||
payload: Maybe<RequestParams>,
|
||||
): Observable<IPaginatedResponse<ResponseModel>> | void;
|
||||
): Observable<IPaginatedResponse<ResponseModel> | IListingResponse<ResponseModel>> | void;
|
||||
|
||||
abstract setColumns(): void;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ export abstract class AbstractSelectComponent<T = ISelectItem, serviceResponse =
|
||||
@Input() canInsert: boolean = false;
|
||||
@Input() showLabel: boolean = true;
|
||||
@Input() showErrors: boolean = true;
|
||||
@Input() showClear: boolean = true;
|
||||
@Input() showClear: boolean = false;
|
||||
@Input() isFullDataOptionValue: boolean = false;
|
||||
@Input() optionValue = 'id';
|
||||
@Output() onChange = new EventEmitter<Maybe<T>>();
|
||||
|
||||
Reference in New Issue
Block a user