I can now list the contents of a table and display a form for one row to update/delete, but haven't implemented update and delete.
This commit is contained in:
parent
2b40d6fdc3
commit
d12817f4cc
4 changed files with 49 additions and 17 deletions
|
@ -24,14 +24,14 @@
|
|||
</header>
|
||||
|
||||
<script>
|
||||
let Tables = new GetJson("/api/admin/table/")
|
||||
console.log("Tables", Tables)
|
||||
let Rows = new GetJson("/api/admin/table/")
|
||||
console.log("Rows", Rows)
|
||||
</script>
|
||||
|
||||
<blockstart>
|
||||
<h1>Admin Tables</h1>
|
||||
<h1>Admin Rows</h1>
|
||||
|
||||
<block x-data="Tables">
|
||||
<block x-data="Rows">
|
||||
<ul>
|
||||
<template x-for="item in theData">
|
||||
<li><a x-bind:href="'/admin/table/' + item + '/'">
|
||||
|
|
|
@ -3,6 +3,7 @@ class GetJson {
|
|||
constructor(url) {
|
||||
this.url = url;
|
||||
this.items = [];
|
||||
this.item = undefined;
|
||||
}
|
||||
|
||||
async theData() {
|
||||
|
@ -11,5 +12,10 @@ class GetJson {
|
|||
this.items = await resp.json();
|
||||
return this.items;
|
||||
}
|
||||
}
|
||||
|
||||
async oneThing() {
|
||||
this.item = await this.theData();
|
||||
console.log("ITEMS", this.items);
|
||||
return this.item;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue