/** * * Store for hub * * * @author Björn Hase * */ import observable from '@riotjs/observable' import notificationStore from '@tiny-components/notification/src/notificationStore.js' export default observable( { /** * getting all hubs, * trigger update after response * * * @param {object} data * */ get(id) { fetch('/api/files/v1/' + id) .then((response) => response.json()) .then((response) => { this.trigger('update', response.data) }) .catch(() => { notificationStore.danger('Error! Connection Problem!') }) } })