traxxx/assets/js/releases/actions.js

27 lines
609 B
JavaScript
Raw Normal View History

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;