forked from DebaucheryLibrarian/traxxx
30 lines
627 B
JavaScript
30 lines
627 B
JavaScript
import dayjs from 'dayjs';
|
|
|
|
import { get } from '../api';
|
|
|
|
function initReleasesActions(_store, _router) {
|
|
async function fetchReleases({ _commit }, {
|
|
id,
|
|
filter,
|
|
after,
|
|
before,
|
|
}) {
|
|
const afterString = dayjs(after).format('YYYY-MM-DD');
|
|
const beforeString = dayjs(before).format('YYYY-MM-DD');
|
|
|
|
const releases = await get(`/releases/${id || ''}`, {
|
|
filter,
|
|
after: afterString,
|
|
before: beforeString,
|
|
});
|
|
|
|
return releases;
|
|
}
|
|
|
|
return {
|
|
fetchReleases,
|
|
};
|
|
}
|
|
|
|
export default initReleasesActions;
|