forked from DebaucheryLibrarian/traxxx
Fixed Babel dependencies.
This commit is contained in:
@@ -263,7 +263,7 @@ function scrollPhotos(event) {
|
||||
|
||||
async function mounted() {
|
||||
[this.actor] = await Promise.all([
|
||||
this.$store.dispatch('fetchActors', { actorId: this.$route.params.actorSlug }),
|
||||
this.$store.dispatch('fetchActors', { actorSlug: this.$route.params.actorSlug }),
|
||||
this.fetchReleases(),
|
||||
]);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import FilterBar from '../header/filter-bar.vue';
|
||||
import Releases from '../releases/releases.vue';
|
||||
|
||||
async function fetchReleases() {
|
||||
this.releases = await this.$store.dispatch('fetchReleases');
|
||||
this.releases = await this.$store.dispatch('fetchReleases', { limit: 100 });
|
||||
}
|
||||
|
||||
async function mounted() {
|
||||
|
||||
@@ -1,12 +1,75 @@
|
||||
import { get } from '../api';
|
||||
import { graphql, get } from '../api';
|
||||
|
||||
function curateActor(actor) {
|
||||
const curatedActor = {
|
||||
...actor,
|
||||
avatar: actor.avatar[0],
|
||||
origin: {
|
||||
country: actor.originCountry,
|
||||
},
|
||||
};
|
||||
|
||||
return curatedActor;
|
||||
}
|
||||
|
||||
function initActorActions(store, _router) {
|
||||
async function fetchActors({ _commit }, { actorId, limit = 100 }) {
|
||||
if (actorId) {
|
||||
return get(`/actors/${actorId}`, { limit });
|
||||
async function fetchActorBySlug(actorSlug) {
|
||||
const { actor } = await graphql(`
|
||||
query Actor($actorSlug:String!) {
|
||||
actor: actorBySlug(slug:$actorSlug) {
|
||||
id
|
||||
name
|
||||
slug
|
||||
avatar: actorsMediasByTargetId(condition: { role:"avatar" }) {
|
||||
thumbnail
|
||||
}
|
||||
originCountry: countryByBirthCountryAlpha2 {
|
||||
alpha2
|
||||
name
|
||||
alias
|
||||
}
|
||||
aliases: actorsByAliasFor {
|
||||
id
|
||||
name
|
||||
slug
|
||||
}
|
||||
}
|
||||
}
|
||||
`, {
|
||||
actorSlug,
|
||||
});
|
||||
|
||||
return curateActor(actor);
|
||||
}
|
||||
|
||||
async function fetchActors({ _commit }, { actorSlug, limit = 100 }) {
|
||||
if (actorSlug) {
|
||||
return fetchActorBySlug(actorSlug);
|
||||
}
|
||||
|
||||
return get('/actors', { limit });
|
||||
const { actors } = await graphql(`
|
||||
query Actors($limit:Int) {
|
||||
actors(first:$limit) {
|
||||
id
|
||||
name
|
||||
slug
|
||||
avatar: actorsMediasByTargetId(condition: { role:"avatar" }) {
|
||||
thumbnail
|
||||
}
|
||||
originCountry: countryByBirthCountryAlpha2 {
|
||||
alpha2
|
||||
name
|
||||
alias
|
||||
}
|
||||
}
|
||||
}
|
||||
`, {
|
||||
limit,
|
||||
});
|
||||
|
||||
console.log(actors);
|
||||
|
||||
return actors.map(actor => curateActor(actor));
|
||||
}
|
||||
|
||||
async function fetchActorReleases({ _commit }, actorId) {
|
||||
|
||||
@@ -21,7 +21,7 @@ function curateRelease(release) {
|
||||
}
|
||||
|
||||
function initReleasesActions(_store, _router) {
|
||||
async function fetchReleases({ _commit }) {
|
||||
async function fetchReleases({ _commit }, { limit = 100 }) {
|
||||
/*
|
||||
const releases = await get('/releases', {
|
||||
filter: store.state.ui.filter,
|
||||
@@ -31,8 +31,8 @@ function initReleasesActions(_store, _router) {
|
||||
*/
|
||||
|
||||
const { releases } = await graphql(`
|
||||
query Releases {
|
||||
releases(orderBy: DATE_DESC) {
|
||||
query Releases($limit:Int) {
|
||||
releases(first:$limit, orderBy: DATE_DESC) {
|
||||
id
|
||||
title
|
||||
description
|
||||
@@ -53,20 +53,14 @@ function initReleasesActions(_store, _router) {
|
||||
alias
|
||||
}
|
||||
avatar: actorsMediasByTargetId(condition: { role: "avatar" }) {
|
||||
id
|
||||
thumbnail
|
||||
path
|
||||
mime
|
||||
}
|
||||
}
|
||||
}
|
||||
poster: releasesMediasByTargetId(condition: { role: "poster" }) {
|
||||
mime
|
||||
id
|
||||
index
|
||||
path
|
||||
thumbnail
|
||||
role
|
||||
}
|
||||
tags: releasesTagsByTargetId {
|
||||
tag {
|
||||
@@ -90,7 +84,9 @@ function initReleasesActions(_store, _router) {
|
||||
}
|
||||
}
|
||||
}
|
||||
`);
|
||||
`, {
|
||||
limit,
|
||||
});
|
||||
|
||||
return releases.map(release => curateRelease(release));
|
||||
}
|
||||
@@ -121,36 +117,24 @@ function initReleasesActions(_store, _router) {
|
||||
alias
|
||||
}
|
||||
avatar: actorsMediasByTargetId(condition: { role: "avatar" }) {
|
||||
id
|
||||
thumbnail
|
||||
path
|
||||
mime
|
||||
}
|
||||
}
|
||||
}
|
||||
poster: releasesMediasByTargetId(condition: { role: "poster" }) {
|
||||
mime
|
||||
id
|
||||
index
|
||||
path
|
||||
thumbnail
|
||||
role
|
||||
}
|
||||
photos: releasesMediasByTargetId(condition: { role: "photo" }) {
|
||||
mime
|
||||
id
|
||||
index
|
||||
path
|
||||
thumbnail
|
||||
role
|
||||
}
|
||||
trailer: releasesMediasByTargetId(condition: { role: "trailer" }) {
|
||||
mime
|
||||
id
|
||||
index
|
||||
path
|
||||
thumbnail
|
||||
role
|
||||
}
|
||||
tags: releasesTagsByTargetId {
|
||||
tag {
|
||||
|
||||
Reference in New Issue
Block a user