working on qr

This commit is contained in:
frontend perkafean
2024-08-05 09:44:01 +00:00
parent 4caf11e4a1
commit 76741e304f
4 changed files with 162 additions and 46 deletions

View File

@@ -102,3 +102,26 @@ export async function getTable(shopId, tableNo) {
console.error("Error:", error);
}
}
export async function getTableByCode(tableCode) {
try {
const response = await fetch(
`${API_BASE_URL}/table/get-table-by-code/${tableCode}`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
},
}
);
if (!response.ok) {
return false;
}
const table = await response.json();
return table;
} catch (error) {
console.error("Error:", error);
}
}