Added basic co-star actor filter to actor page.

This commit is contained in:
DebaucheryLibrarian
2020-09-12 03:09:05 +02:00
parent 24fb267b40
commit 62f5d5111a
7 changed files with 155 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
import config from 'config';
import { graphql, get } from '../api';
import { releaseFields, getIncludedEntities } from '../fragments';
import { releaseFields, getIncludedEntities, getIncludedActors } from '../fragments';
import { curateActor, curateRelease } from '../curate';
import getDateRange from '../get-date-range';
@@ -26,7 +26,8 @@ function initActorActions(store, router) {
$selectableTags: [String],
$includedTags: [String!],
$mode: String!,
$includedEntities: [ReleaseFilter!]
$includedEntities: [ReleaseFilter!],
$includedActors: [ReleaseFilter!]
) {
actor(id: $actorId) {
id
@@ -160,13 +161,25 @@ function initActorActions(store, router) {
type
}
}
actors {
id
name
slug
}
scenesConnection(
filter: {
date: {
lessThan: $before,
greaterThan: $after,
}
or: $includedEntities
and: [
{
or: $includedEntities
}
{
or: $includedActors
}
]
}
selectedTags: $includedTags
mode: $mode
@@ -192,6 +205,7 @@ function initActorActions(store, router) {
excludeTags: store.state.ui.filter,
includedTags,
includedEntities: getIncludedEntities(router),
includedActors: getIncludedActors(router),
mode,
});