2019-06-03 03:31:38 +00:00
|
|
|
import { get } from '../api';
|
|
|
|
|
2019-11-15 01:37:17 +00:00
|
|
|
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,
|
2019-11-15 00:27:58 +00:00
|
|
|
});
|
2019-06-03 03:31:38 +00:00
|
|
|
|
|
|
|
return releases;
|
|
|
|
}
|
|
|
|
|
2019-11-15 01:37:17 +00:00
|
|
|
async function fetchReleaseById({ _commit }, releaseId) {
|
|
|
|
const release = await get(`/releases/${releaseId}`);
|
|
|
|
|
|
|
|
return release;
|
|
|
|
}
|
|
|
|
|
2019-06-03 03:31:38 +00:00
|
|
|
return {
|
|
|
|
fetchReleases,
|
2019-11-15 01:37:17 +00:00
|
|
|
fetchReleaseById,
|
2019-06-03 03:31:38 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default initReleasesActions;
|