traxxx/assets/js/stashes/actions.js

29 lines
678 B
JavaScript

import { post, del } from '../api';
function initStashesActions(_store, _router) {
async function stashActor(context, { actorId, stashId }) {
await post(`/stashes/${stashId}/actors`, { actorId });
}
async function unstashActor(context, { actorId, stashId }) {
await del(`/stashes/${stashId}/actors/${actorId}`);
}
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 {
stashActor,
stashScene,
unstashActor,
unstashScene,
};
}
export default initStashesActions;