diff --git a/src/App.vue b/src/App.vue index 5f388e0..9fee86d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -19,22 +19,30 @@ 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').then((resp) => allTables.value = resp.data) + axios.get('http://localhost/api/active_tables').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')).then((resp) => allTables.value = resp.data) + activate.then((resp) => axios.get('http://localhost/api/active_tables')).then((resp) => activeTables.value = resp.data) +} + @@ -63,17 +71,16 @@ onMounted(() => { -