forked from DebaucheryLibrarian/traxxx
27 lines
609 B
JavaScript
27 lines
609 B
JavaScript
import { get } from '../api';
|
|
|
|
function initReleasesActions(store, _router) {
|
|
async function fetchReleases({ _commit }) {
|
|
const releases = await get('/releases', {
|
|
filter: store.state.ui.filter,
|
|
after: store.getters.after,
|
|
before: store.getters.before,
|
|
});
|
|
|
|
return releases;
|
|
}
|
|
|
|
async function fetchReleaseById({ _commit }, releaseId) {
|
|
const release = await get(`/releases/${releaseId}`);
|
|
|
|
return release;
|
|
}
|
|
|
|
return {
|
|
fetchReleases,
|
|
fetchReleaseById,
|
|
};
|
|
}
|
|
|
|
export default initReleasesActions;
|