Added rudimentary tags page. Improved social match behavior.

This commit is contained in:
2019-12-01 05:32:47 +01:00
parent bead69de49
commit cf81aa99e0
41 changed files with 495 additions and 104 deletions

View File

@@ -21,7 +21,7 @@ async function fetchActorsApi(req, res) {
return;
}
const actors = await fetchActors();
const actors = await fetchActors(null, req.query.limit);
res.send(actors);
}

View File

@@ -6,10 +6,24 @@ async function fetchTagsApi(req, res) {
const tagId = typeof req.params.tagId === 'number' ? req.params.tagId : undefined; // null will literally include NULL results
const tagSlug = typeof req.params.tagId === 'string' ? req.params.tagId : undefined;
if (tagId || tagSlug) {
const tags = await fetchTags({
id: tagId,
slug: tagSlug,
}, req.query.limit);
if (tags.length > 0) {
res.send(tags[0]);
return;
}
res.status(404).send();
return;
}
const tags = await fetchTags({
id: tagId,
slug: tagSlug,
});
priority: req.query.priority.split(','),
}, req.query.limit);
res.send(tags);
}