2021-03-15 02:30:47 +00:00
|
|
|
import { post, del } from '../api';
|
2021-03-14 03:54:43 +00:00
|
|
|
|
|
|
|
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-14 03:54:43 +00:00
|
|
|
|
2021-03-15 02:30:47 +00:00
|
|
|
async function unstashActor(context, { actorId, stashId }) {
|
|
|
|
await del(`/stashes/${stashId}/actors/${actorId}`);
|
2021-03-14 03:54:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
2021-03-15 02:30:47 +00:00
|
|
|
stashActor,
|
|
|
|
unstashActor,
|
2021-03-14 03:54:43 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default initStashesActions;
|