Moved tag filter modes to postgres function.

This commit is contained in:
DebaucheryLibrarian
2020-07-19 04:25:07 +02:00
parent cf999896d5
commit 70bf00e844
3 changed files with 15 additions and 18 deletions

View File

@@ -25,6 +25,7 @@ function initActorActions(store, router) {
$orderBy:[ReleasesOrderBy!]
$selectableTags: [String],
$includeTags: [String!],
$mode: String!,
) {
actor(id: $actorId) {
id
@@ -151,19 +152,9 @@ function initActorActions(store, router) {
lessThan: $before,
greaterThan: $after,
}
${mode === 'any' ? `
releasesTagsConnection: {
some: {
tag: {
slug: {
in: $includeTags
}
}
}
}
` : ''}
}
${mode === 'all' ? 'selectedTags: $includeTags' : ''}
selectedTags: $includeTags
mode: $mode
first: $limit
offset: $offset
orderBy: $orderBy
@@ -185,6 +176,7 @@ function initActorActions(store, router) {
orderBy,
excludeTags: store.state.ui.filter,
includeTags,
mode,
});
return {