2019-11-10 03:20:22 +00:00
|
|
|
import { get } from '../api';
|
|
|
|
|
2019-11-15 04:10:59 +00:00
|
|
|
function initActorActions(store, _router) {
|
2019-12-01 04:32:47 +00:00
|
|
|
async function fetchActors({ _commit }, { actorId, limit = 100 }) {
|
|
|
|
if (actorId) {
|
|
|
|
return get(`/actors/${actorId}`, { limit });
|
|
|
|
}
|
2019-11-10 03:20:22 +00:00
|
|
|
|
2019-12-01 04:32:47 +00:00
|
|
|
return get('/actors', { limit });
|
2019-11-10 03:20:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
async function fetchActorReleases({ _commit }, actorId) {
|
2019-11-15 04:10:59 +00:00
|
|
|
const releases = await get(`/actors/${actorId}/releases`, {
|
|
|
|
filter: store.state.ui.filter,
|
|
|
|
after: store.getters.after,
|
|
|
|
before: store.getters.before,
|
|
|
|
});
|
2019-11-10 03:20:22 +00:00
|
|
|
|
|
|
|
return releases;
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
fetchActors,
|
|
|
|
fetchActorReleases,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default initActorActions;
|