traxxx/assets/js/stashes/actions.js

29 lines
678 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}`);
}
return {
2021-03-15 02:30:47 +00:00
stashActor,
2021-03-17 01:09:34 +00:00
stashScene,
2021-03-15 02:30:47 +00:00
unstashActor,
2021-03-17 01:09:34 +00:00
unstashScene,
};
}
export default initStashesActions;