make the start button work

This commit is contained in:
iamBadgers
2026-03-22 23:02:01 -07:00
parent 91f7755af9
commit fb82472cac

View File

@@ -23,14 +23,22 @@ onMounted(() => {
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)
}
</script>
<style>
.ActiveTables {
margin: 20px;
h2 {
padding-left: 15px;
}
.ATTables {
padding-left: 50px;
}
@@ -68,7 +76,7 @@ onMounted(() => {
<Column field="table_link" header="Table Link" />
<Column header="Close">
<template #body="slotProps">
<Button label="Close"/>
<Button label="Start" @click="startTable(slotProps.data.id)" />
</template>
</Column>
</DataTable>
@@ -76,4 +84,3 @@ onMounted(() => {
</Card>
</template>