traxxx/assets/js/networks/actions.js

29 lines
672 B
JavaScript

import { get } from '../api';
function initNetworksActions(store, _router) {
async function fetchNetworks({ _commit }, networkId) {
const networks = await get(`/networks/${networkId || ''}`, {
});
return networks;
}
async function fetchNetworkReleases({ _commit }, networkId) {
const releases = await get(`/networks/${networkId}/releases`, {
filter: store.state.ui.filter,
after: store.getters.after,
before: store.getters.before,
});
return releases;
}
return {
fetchNetworks,
fetchNetworkReleases,
};
}
export default initNetworksActions;