Fixing not working database/new admin endpoint
This commit is contained in:
parent
65d1710902
commit
6036556a37
@ -6,11 +6,11 @@ import V1 from "./v1";
|
||||
|
||||
const Web = new koa();
|
||||
|
||||
Web.use(RequestLog)
|
||||
Web.use(RequestLog);
|
||||
Web.use(RequestError);
|
||||
Web.use(BodyParser({}))
|
||||
Web.use(BodyParser({}));
|
||||
|
||||
Web.use(V1.routes())
|
||||
Web.use(V1.allowedMethods())
|
||||
Web.use(V1.routes());
|
||||
Web.use(V1.allowedMethods());
|
||||
|
||||
export default Web;
|
@ -55,14 +55,17 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const url = "{{url}}";
|
||||
let u = new URL("{{url}}", window.location.origin);
|
||||
let key = new URL(window.location.href).searchParams.get("key");
|
||||
if (key)
|
||||
u.searchParams.set("key", key);
|
||||
|
||||
const message = document.getElementById("message");
|
||||
const form = document.getElementById("f1");
|
||||
function submitData() {
|
||||
let res = {};
|
||||
Array.from(new FormData(form).entries()).forEach(([name, value]) => res[name] = value);
|
||||
fetch(url, {
|
||||
fetch(u.href, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"content-type": "application/json"
|
||||
|
Reference in New Issue
Block a user