From 157eb569ccc513cb3adaafc5aeef7d0d30fceed0 Mon Sep 17 00:00:00 2001 From: iamBadgers Date: Thu, 9 Apr 2026 20:19:56 -0700 Subject: [PATCH] minor guff around linkages --- src/TableManager.vue | 51 ++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/src/TableManager.vue b/src/TableManager.vue index 5db2ce2..65a3d2c 100644 --- a/src/TableManager.vue +++ b/src/TableManager.vue @@ -21,27 +21,27 @@ onMounted(() => { }, ] - axios.get('http://localhost/api/tables').then((resp) => (allTables.value = resp.data)) - axios.get('http://localhost/api/active_tables').then((resp) => (activeTables.value = resp.data)) + axios.get('http://localhost/api/tables/all').then((resp) => (allTables.value = resp.data)) + axios.get('http://localhost/api/tables/active').then((resp) => (activeTables.value = resp.data)) }) function startTable(tableId: number) { - const activate = axios.get(`http://localhost/api/tables/${tableId}:start`) - activate - .then((resp) => axios.get('http://localhost/api/tables')) + const start = axios.post(`http://localhost/api/tables/${tableId}:start`) + start + .then((resp) => axios.get('http://localhost/api/tables/all')) .then((resp) => (allTables.value = resp.data)) - activate - .then((resp) => axios.get('http://localhost/api/active_tables')) + start + .then((resp) => axios.get('http://localhost/api/tables/active')) .then((resp) => (activeTables.value = resp.data)) } function stopTable(tableId: number) { - const activate = axios.get(`http://localhost/api/tables/${tableId}:stop`) - activate - .then((resp) => axios.get('http://localhost/api/tables')) + const stop = axios.post(`http://localhost/api/tables/${tableId}:stop`) + stop + .then((resp) => axios.get('http://localhost/api/tables/all')) .then((resp) => (allTables.value = resp.data)) - activate - .then((resp) => axios.get('http://localhost/api/active_tables')) + stop + .then((resp) => axios.get('http://localhost/api/tables/active')) .then((resp) => (activeTables.value = resp.data)) } @@ -60,7 +60,7 @@ function buildButtonModel(id: number) { function createTable() { axios.post("http://localhost/api/tables", - {table_name: "table name", table_link: "table link"}) + { table_name: "table name", table_link: "table link" }) } @@ -107,14 +107,8 @@ function createTable() { @@ -136,7 +130,18 @@ function createTable() { - + + + +