Getting a forum with id's works
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<h1>api</h1>
|
||||
<a href="/api/foorum">foorum</a>
|
||||
<button onclick="getForum(prompt('ForumId: ', '1'))">GetForum</button>
|
||||
<button onclick="getForums()">GetAllForums</button>
|
||||
<button onclick="addForum()">AddForum</button>
|
||||
<code><pre id="output"></pre></code>
|
||||
@@ -7,6 +8,15 @@
|
||||
<script>
|
||||
var out = document.getElementById("output");
|
||||
|
||||
function getForum(id) {
|
||||
fetch("/api/foorum/"+id).then(resp => {
|
||||
return resp.json();
|
||||
}).then(data => {
|
||||
console.log(data);
|
||||
out.innerText = JSON.stringify(data, null, 2);
|
||||
});
|
||||
}
|
||||
|
||||
function getForums() {
|
||||
fetch("/api/foorum").then(resp => {
|
||||
return resp.json();
|
||||
|
||||
Reference in New Issue
Block a user