Fixed api
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user