Ported:
Table Merge/Move and Kot Merge/Move
This commit is contained in:
@ -100,45 +100,41 @@ export class VoucherService {
|
||||
}
|
||||
|
||||
moveTable(id: string, table: Table): Observable<boolean> {
|
||||
const options = {params: new HttpParams().set('move', '')};
|
||||
return <Observable<boolean>>this.http.post<boolean>(urlMoveTable, {
|
||||
voucher: {id: id},
|
||||
table: {id: table.id}
|
||||
}, options).pipe(
|
||||
return <Observable<boolean>>this.http.post<boolean>(`${urlMoveTable}/move`, {
|
||||
voucherId: id,
|
||||
tableId: table.id
|
||||
}).pipe(
|
||||
catchError(this.log.handleError(serviceName, 'moveTable'))
|
||||
);
|
||||
}
|
||||
|
||||
mergeTable(id: string, table: Table): Observable<boolean> {
|
||||
const options = {params: new HttpParams().set('merge', '')};
|
||||
return <Observable<boolean>>this.http.post<boolean>(urlMoveTable, {
|
||||
voucher: {id: id},
|
||||
table: {id: table.id},
|
||||
newVoucher: {id: table.voucherId}
|
||||
}, options).pipe(
|
||||
return <Observable<boolean>>this.http.post<boolean>(`${urlMoveTable}/merge`, {
|
||||
voucherId: id,
|
||||
tableId: table.id,
|
||||
newVoucherId: table.voucherId
|
||||
}).pipe(
|
||||
catchError(this.log.handleError(serviceName, 'mergeTable'))
|
||||
);
|
||||
}
|
||||
|
||||
moveKotToNewTable(id: string, kotId: string, table: Table): Observable<boolean> {
|
||||
const options = {params: new HttpParams().set('move', '')};
|
||||
return <Observable<boolean>>this.http.post<boolean>(urlMoveKot, {
|
||||
voucher: {id: id},
|
||||
kot: {id: kotId},
|
||||
table: {id: table.id}
|
||||
}, options).pipe(
|
||||
return <Observable<boolean>>this.http.post<boolean>(`${urlMoveKot}/move`, {
|
||||
voucherId: id,
|
||||
kotId: kotId,
|
||||
tableId: table.id
|
||||
}).pipe(
|
||||
catchError(this.log.handleError(serviceName, 'moveKotToNewTable'))
|
||||
);
|
||||
}
|
||||
|
||||
mergeKotWithOldBill(id: string, kotId: string, table: Table): Observable<boolean> {
|
||||
const options = {params: new HttpParams().set('merge', '')};
|
||||
return <Observable<boolean>>this.http.post<boolean>(urlMoveKot, {
|
||||
voucher: {id: id},
|
||||
kot: {id: kotId},
|
||||
table: {id: table.id},
|
||||
newVoucher: {id: table.voucherId}
|
||||
}, options).pipe(
|
||||
return <Observable<boolean>>this.http.post<boolean>(`${urlMoveKot}/merge`, {
|
||||
voucherId: id,
|
||||
kotId: kotId,
|
||||
tableId: table.id,
|
||||
newVoucherId: table.voucherId
|
||||
}).pipe(
|
||||
catchError(this.log.handleError(serviceName, 'mergeKotWithOldBill'))
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user