2019-11-10 03:20:22 +00:00
|
|
|
import { get } from '../api';
|
|
|
|
|
2019-11-15 01:37:17 +00:00
|
|
|
function initNetworksActions(store, _router) {
|
2019-11-10 03:20:22 +00:00
|
|
|
async function fetchNetworks({ _commit }, networkId) {
|
2019-11-15 01:37:17 +00:00
|
|
|
const networks = await get(`/networks/${networkId || ''}`, {
|
|
|
|
|
|
|
|
});
|
2019-11-10 03:20:22 +00:00
|
|
|
|
|
|
|
return networks;
|
|
|
|
}
|
|
|
|
|
|
|
|
async function fetchNetworkReleases({ _commit }, networkId) {
|
2019-11-15 01:37:17 +00:00
|
|
|
const releases = await get(`/networks/${networkId}/releases`, {
|
|
|
|
filter: store.state.ui.filter,
|
|
|
|
after: store.getters.after,
|
|
|
|
before: store.getters.before,
|
|
|
|
});
|
2019-11-10 03:20:22 +00:00
|
|
|
|
|
|
|
return releases;
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
fetchNetworks,
|
|
|
|
fetchNetworkReleases,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default initNetworksActions;
|