traxxx/assets/js/stashes/actions.js

39 lines
949 B
JavaScript
Raw Normal View History

2021-03-15 02:30:47 +00:00
import { post, del } from '../api';
function initStashesActions(_store, _router) {
2021-03-15 02:30:47 +00:00
async function stashActor(context, { actorId, stashId }) {
await post(`/stashes/${stashId}/actors`, { actorId });
}
2021-03-15 02:30:47 +00:00
async function unstashActor(context, { actorId, stashId }) {
await del(`/stashes/${stashId}/actors/${actorId}`);
}
2021-03-17 01:09:34 +00:00
async function stashScene(context, { sceneId, stashId }) {
await post(`/stashes/${stashId}/scenes`, { sceneId });
}
async function unstashScene(context, { sceneId, stashId }) {
await del(`/stashes/${stashId}/scenes/${sceneId}`);
}
async function stashMovie(context, { movieId, stashId }) {
await post(`/stashes/${stashId}/movies`, { movieId });
}
async function unstashMovie(context, { movieId, stashId }) {
await del(`/stashes/${stashId}/movies/${movieId}`);
}
return {
2021-03-15 02:30:47 +00:00
stashActor,
2021-03-17 01:09:34 +00:00
stashScene,
stashMovie,
2021-03-15 02:30:47 +00:00
unstashActor,
2021-03-17 01:09:34 +00:00
unstashScene,
unstashMovie,
};
}
export default initStashesActions;