forked from DebaucheryLibrarian/traxxx
Added stashes with experimental row security policies. Added tag photos.
This commit is contained in:
102
assets/js/stashes/actions.js
Normal file
102
assets/js/stashes/actions.js
Normal file
@@ -0,0 +1,102 @@
|
||||
import { graphql } from '../api';
|
||||
import { curateStash } from '../curate';
|
||||
|
||||
function initStashesActions(_store, _router) {
|
||||
async function fetchUserStashes(context, userId) {
|
||||
const { stashes } = await graphql(`
|
||||
query Stashes(
|
||||
$userId: Int!
|
||||
) {
|
||||
stashes(
|
||||
filter: {
|
||||
userId: {
|
||||
equalTo: $userId
|
||||
}
|
||||
}
|
||||
) {
|
||||
id
|
||||
name
|
||||
actors: stashesActors {
|
||||
comment
|
||||
actor {
|
||||
id
|
||||
name
|
||||
slug
|
||||
gender
|
||||
age
|
||||
ageFromBirth
|
||||
dateOfBirth
|
||||
birthCity
|
||||
birthState
|
||||
birthCountry: countryByBirthCountryAlpha2 {
|
||||
alpha2
|
||||
name
|
||||
alias
|
||||
}
|
||||
avatar: avatarMedia {
|
||||
id
|
||||
path
|
||||
thumbnail
|
||||
lazy
|
||||
}
|
||||
}
|
||||
}
|
||||
scenes: stashesScenes {
|
||||
comment
|
||||
scene {
|
||||
id
|
||||
title
|
||||
slug
|
||||
url
|
||||
date
|
||||
actors: releasesActors {
|
||||
actor {
|
||||
id
|
||||
name
|
||||
slug
|
||||
}
|
||||
}
|
||||
tags: releasesTags {
|
||||
tag {
|
||||
id
|
||||
name
|
||||
slug
|
||||
}
|
||||
}
|
||||
entity {
|
||||
id
|
||||
name
|
||||
slug
|
||||
independent
|
||||
parent {
|
||||
id
|
||||
name
|
||||
slug
|
||||
independent
|
||||
}
|
||||
}
|
||||
poster: releasesPosterByReleaseId {
|
||||
media {
|
||||
path
|
||||
thumbnail
|
||||
lazy
|
||||
isS3
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`, {
|
||||
userId,
|
||||
});
|
||||
|
||||
return stashes.map(stash => curateStash(stash));
|
||||
}
|
||||
|
||||
return {
|
||||
fetchUserStashes,
|
||||
};
|
||||
}
|
||||
|
||||
export default initStashesActions;
|
||||
1
assets/js/stashes/mutations.js
Normal file
1
assets/js/stashes/mutations.js
Normal file
@@ -0,0 +1 @@
|
||||
export default {};
|
||||
13
assets/js/stashes/stashes.js
Normal file
13
assets/js/stashes/stashes.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import state from './state';
|
||||
import mutations from './mutations';
|
||||
import actions from './actions';
|
||||
|
||||
function initStashesStore(store, router) {
|
||||
return {
|
||||
state,
|
||||
mutations,
|
||||
actions: actions(store, router),
|
||||
};
|
||||
}
|
||||
|
||||
export default initStashesStore;
|
||||
1
assets/js/stashes/state.js
Normal file
1
assets/js/stashes/state.js
Normal file
@@ -0,0 +1 @@
|
||||
export default {};
|
||||
Reference in New Issue
Block a user