forked from DebaucheryLibrarian/traxxx
29 lines
675 B
JavaScript
29 lines
675 B
JavaScript
import { get } from '../api';
|
|
|
|
function initTagsActions(store, _router) {
|
|
async function fetchTags({ _commit }, { tagId, limit = 100, priority }) {
|
|
if (tagId) {
|
|
return get(`/tags/${tagId}`);
|
|
}
|
|
|
|
return get('/tags', { limit, priority });
|
|
}
|
|
|
|
async function fetchTagReleases({ _commit }, tagId) {
|
|
const releases = await get(`/tags/${tagId}/releases`, {
|
|
filter: store.state.ui.filter,
|
|
after: store.getters.after,
|
|
before: store.getters.before,
|
|
});
|
|
|
|
return releases;
|
|
}
|
|
|
|
return {
|
|
fetchTags,
|
|
fetchTagReleases,
|
|
};
|
|
}
|
|
|
|
export default initTagsActions;
|