Get the close working as well

This commit is contained in:
iamBadgers
2026-03-24 01:07:22 -07:00
parent fb82472cac
commit 31f77e50d9

View File

@@ -29,6 +29,12 @@ function startTable(tableId: number) {
activate.then((resp) => axios.get('http://localhost/api/active_tables')).then((resp) => activeTables.value = resp.data) activate.then((resp) => axios.get('http://localhost/api/active_tables')).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')).then((resp) => allTables.value = resp.data)
activate.then((resp) => axios.get('http://localhost/api/active_tables')).then((resp) => activeTables.value = resp.data)
}
</script> </script>
<style> <style>
@@ -58,7 +64,7 @@ function startTable(tableId: number) {
<Column field="table_link" header="Table Link" /> <Column field="table_link" header="Table Link" />
<Column header="Close"> <Column header="Close">
<template #body="slotProps"> <template #body="slotProps">
<Button label="Close" /> <Button label="Close" @click="stopTable(slotProps.data.id)"/>
</template> </template>
</Column> </Column>
</DataTable> </DataTable>