Enabled network filters for actors. Separated filter definition for entities.

This commit is contained in:
DebaucheryLibrarian
2020-09-09 03:28:33 +02:00
parent 00f1fc39fa
commit d1cdd60ee8
6 changed files with 97 additions and 47 deletions

View File

@@ -319,6 +319,48 @@ const releaseFragment = `
}
`;
function getIncludedEntities(router) {
const includedChannels = router.currentRoute.query.channels ? router.currentRoute.query.channels.split(',') : [];
const includedNetworks = router.currentRoute.query.networks ? router.currentRoute.query.networks.split(',') : [];
if (includedChannels.length === 0 && includedNetworks.length === 0) {
return [];
}
return [
{
entity: {
slug: {
in: includedChannels,
},
},
},
{
entity: {
parent: {
type: {
equalTo: 'network',
},
slug: {
in: includedNetworks,
},
},
},
},
{
entity: {
type: {
equalTo: 'network',
},
slug: {
in: includedNetworks,
},
},
},
];
}
export {
releaseActorsFragment,
releaseFields,
@@ -330,4 +372,5 @@ export {
releaseFragment,
siteFragment,
sitesFragment,
getIncludedEntities,
};