I can now submit a form and store it in the database.
This commit is contained in:
parent
eaaab2ac0b
commit
4045799ab9
4 changed files with 87 additions and 10 deletions
|
@ -9,7 +9,8 @@
|
|||
<script defer src="/js/alpine.js"></script>
|
||||
<script src="/js/code.js"></script>
|
||||
<script>
|
||||
let req = new GetJson("/api/live/index.json");
|
||||
let req = new GetJson("/api/stream/1");
|
||||
let link_req = new GetJson("/api/stream/1/links");
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
@ -26,8 +27,8 @@
|
|||
|
||||
<block>
|
||||
<h2>Links Found in Chat</h2>
|
||||
<ul>
|
||||
<template x-for="item in Stream.links">
|
||||
<ul x-init="links = await link_req.theData()" x-data="{links: {}}">
|
||||
<template x-for="item in links">
|
||||
<li><a x-text="item.description" x-bind:href="item.url"></a></li>
|
||||
</template>
|
||||
</ul>
|
||||
|
@ -37,7 +38,9 @@
|
|||
<card>
|
||||
<top>Submit a Link</top>
|
||||
<middle>
|
||||
<input type="text" placeholder="Link Url">
|
||||
<input name="stream_id" type="hidden" value="1">
|
||||
<input name="url" type="text" placeholder="Link Url">
|
||||
<input name="description" type="text" placeholder="Description">
|
||||
</middle>
|
||||
</card>
|
||||
<buttons>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue