forked from DebaucheryLibrarian/traxxx
Added tag filter to releases query, enabled on homepage.
This commit is contained in:
@@ -6,7 +6,10 @@ async function fetchActorsApi(req, res) {
|
||||
const actorId = typeof req.params.actorId === 'number' ? req.params.actorId : null;
|
||||
const actorSlug = typeof req.params.actorId === 'string' ? req.params.actorId : null;
|
||||
|
||||
const actors = await fetchActors(actorId, actorSlug);
|
||||
const actors = await fetchActors({
|
||||
id: actorId,
|
||||
slug: actorSlug,
|
||||
});
|
||||
|
||||
res.send(actors);
|
||||
}
|
||||
|
||||
@@ -3,10 +3,13 @@
|
||||
const { fetchNetworks, fetchNetworksFromReleases } = require('../networks');
|
||||
|
||||
async function fetchNetworksApi(req, res) {
|
||||
const networkId = typeof req.params.networkId === 'number' ? req.params.networkId : null;
|
||||
const networkSlug = typeof req.params.networkId === 'string' ? req.params.networkId : null;
|
||||
const networkId = typeof req.params.networkId === 'number' ? req.params.networkId : undefined; // null will literally include NULL results
|
||||
const networkSlug = typeof req.params.networkId === 'string' ? req.params.networkId : undefined;
|
||||
|
||||
const networks = await fetchNetworks(networkId, networkSlug);
|
||||
const networks = await fetchNetworks({
|
||||
id: networkId,
|
||||
slug: networkSlug,
|
||||
});
|
||||
|
||||
res.send(networks);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ const {
|
||||
} = require('../releases');
|
||||
|
||||
async function fetchReleasesApi(req, res) {
|
||||
const releases = await fetchReleases(req.params.releaseId);
|
||||
const releases = await fetchReleases(req.params.releaseId, req.query.filter ? [].concat(req.query.filter) : []);
|
||||
|
||||
res.send(releases);
|
||||
}
|
||||
|
||||
@@ -3,10 +3,13 @@
|
||||
const { fetchTags } = require('../tags');
|
||||
|
||||
async function fetchTagsApi(req, res) {
|
||||
const tagId = typeof req.params.tagId === 'number' ? req.params.tagId : null;
|
||||
const tagSlug = typeof req.params.tagId === 'string' ? req.params.tagId : null;
|
||||
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;
|
||||
|
||||
const tags = await fetchTags(tagId, tagSlug);
|
||||
const tags = await fetchTags({
|
||||
id: tagId,
|
||||
slug: tagSlug,
|
||||
});
|
||||
|
||||
res.send(tags);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user