Fix: Prevent creation of customer with blank name when adding a guest book item.
Fix: Also prevent creation of customer with blank phone number when adding a guest book. Feature: Show the old bill of a customer in guest book Fix: In reprint, allow changing of customer Chore: Updated dependencies
This commit is contained in:
@ -22,6 +22,9 @@ export class BillResolver implements Resolve<Bill> {
|
||||
if (tableId !== null) {
|
||||
return this.ser.getFromTable(tableId as string, voucherId, guestId);
|
||||
}
|
||||
if (voucherId !== null) {
|
||||
return this.ser.getFromId(voucherId);
|
||||
}
|
||||
throw new Error('Unable to get bill');
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,6 +52,12 @@ export class VoucherService {
|
||||
.pipe(catchError(this.log.handleError(serviceName, `getFromBill billId=${billId}`))) as Observable<Bill>;
|
||||
}
|
||||
|
||||
getFromId(voucherId: string): Observable<Bill> {
|
||||
return this.http
|
||||
.get<Bill>(`${url}/from-id/${voucherId}`)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `getFromId voucherId=${voucherId}`))) as Observable<Bill>;
|
||||
}
|
||||
|
||||
save(voucher: Bill, voucherType: VoucherType, guestBookId: string | null, updateTable: boolean): Observable<boolean> {
|
||||
const options = {
|
||||
params: new HttpParams().set('p', voucherType.toString()).set('u', updateTable.toString()),
|
||||
|
||||
Reference in New Issue
Block a user