Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Commit

Permalink
printer things
Browse files Browse the repository at this point in the history
  • Loading branch information
DCRepublic committed Apr 2, 2024
1 parent 0692c34 commit cd9a2fd
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/app/(header)/point_of_sale/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,19 @@ export default function App() {
total: runningTotal,
hidden: false,
notes: '',
oc: oneCard,
payment: paymentType,
receipt: true,
dishes: currentOrder.filter((item: any) => item.tag == 'food'),
};
const drinkies = {
customerName: name,
total: runningTotal,
hidden: false,
notes: '',
oc: oneCard,
payment: paymentType,
receipt: true,
dishes: currentOrder.filter((item: any) => item.tag == 'drink'),
};

Expand Down Expand Up @@ -402,7 +408,17 @@ export default function App() {
}

//Send order to print server/tablet
await axios.post('/api/print', toPrintServer).then((response) => {
await axios.post('/api/print', foodies).then((response) => {
if (response.status == 200) {
setSuccess(true);
setTimeout(handleSuccess, 3000);
} else {
setFailure(true);
setTimeout(handleFailure, 3000);
}
});

await axios.post('/api/print', drinkies).then((response) => {
if (response.status == 200) {
setSuccess(true);
setTimeout(handleSuccess, 3000);
Expand Down

0 comments on commit cd9a2fd

Please sign in to comment.