traxxx/assets/js/sites/actions.js

23 lines
479 B
JavaScript
Raw Normal View History

import { get } from '../api';
function initSitesActions(_store, _router) {
async function fetchSites({ _commit }, siteId) {
const sites = await get(`/sites/${siteId || ''}`);
return sites;
}
async function fetchSiteReleases({ _commit }, siteId) {
const releases = await get(`/sites/${siteId}/releases`);
return releases;
}
return {
fetchSites,
fetchSiteReleases,
};
}
export default initSitesActions;