Fixed query build error & added api to landingpage
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const prefix = "";
|
||||
const prefix = document.getElementsByTagName("base")[0].href;
|
||||
async function unknownResponse(resp) {
|
||||
let json = await resp.json();
|
||||
try {
|
||||
@@ -18,10 +18,10 @@ function buildQuery(options) {
|
||||
else if (element[1] instanceof Array) {
|
||||
element[1] = JSON.stringify(element[1]);
|
||||
}
|
||||
query.push(`${element[0]}&${element[1]}`);
|
||||
query.push(`${element[0]}=${element[1]}`);
|
||||
}
|
||||
});
|
||||
return query.join("=");
|
||||
return query.join("&");
|
||||
}
|
||||
async function login(username, password) {
|
||||
let result = await fetch(`${prefix}/api/login`, {
|
||||
|
||||
Reference in New Issue
Block a user