Files
psp_panel/src/app/modules/pos/views/pos.component.ts
T

41 lines
1.1 KiB
TypeScript
Raw Normal View History

import { Maybe } from '@/core';
import { JalaliDateDirective } from '@/shared/directives';
import { Component, signal } from '@angular/core';
import images from 'src/assets/images';
import { PosOrderCardComponent } from '../components/order/order-card.component';
import { PosProductsComponent } from '../components/products/products.component';
import { IPosInfoResponse } from '../models';
import { PosService } from '../services/main.service';
@Component({
selector: 'app-pos',
templateUrl: './pos.component.html',
imports: [JalaliDateDirective, PosProductsComponent, PosOrderCardComponent],
})
export class POSComponent {
constructor(private service: PosService) {
this.getInfo();
}
placeholderLogo = images.placeholders.logo;
now = new Date();
inventoryId = 2;
info = signal<Maybe<IPosInfoResponse>>(null);
infoLoading = signal(true);
getInfo() {
this.infoLoading.set(true);
this.service.getInfo().subscribe({
next: (res) => {
this.info.set(res);
this.infoLoading.set(false);
},
error: () => {
this.infoLoading.set(false);
},
});
}
}