forked from DebaucheryLibrarian/traxxx
Enabled network filters for actors. Separated filter definition for entities.
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user