Fixed api

This commit is contained in:
2022-01-31 12:07:55 +01:00
parent 5171c39861
commit 320c215492
3 changed files with 5 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ async function unknownResponse(resp) {
}
}
function buildQuery(options) {
let query;
let query = [];
options.forEach(element => {
if (element[1] !== undefined) {
if (element[1] instanceof Date) {
@@ -59,7 +59,7 @@ async function tags(name, limit) {
}
async function recent(limit = 20) {
let query = [["limit", limit]];
let result = await fetch(`${prefix}/api/recent?limit=${buildQuery(query)}`);
let result = await fetch(`${prefix}/api/recent?${buildQuery(query)}`);
if (result.status == 200) {
return await result.json();
}