Added tag filter to releases query, enabled on homepage.

This commit is contained in:
2019-11-13 03:14:24 +01:00
parent d1212725bb
commit f9f9cc7977
26 changed files with 555 additions and 192 deletions

View File

@@ -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);
}