Move Table with confirm

This commit is contained in:
Amritanshu
2019-08-10 14:21:40 +05:30
parent 4fb8d9118e
commit 2fcff26e34
12 changed files with 248 additions and 33 deletions

View File

@ -4,6 +4,7 @@ import { catchError } from 'rxjs/operators';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { ErrorLoggerService } from '../../core/error-logger.service';
import { Bill, PrintType } from './bill';
import { Table } from "../../core/table";
const httpOptions = {
headers: new HttpHeaders({'Content-Type': 'application/json'})
@ -83,4 +84,12 @@ export class VoucherService {
catchError(this.log.handleError(serviceName, 'receivePayment'))
);
}
moveTable(id: string, table: Table): Observable<boolean> {
const options = {params: new HttpParams().set('m', table.id)};
return <Observable<boolean>>this.http.post<boolean>(`${url}/${id}`, {}, options)
.pipe(
catchError(this.log.handleError(serviceName, 'moveTable'))
);
}
}