You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
697 B

/**
*
* 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()
{
fetch('/api/hubs/v1')
.then((response) => response.json())
.then((response) => {
this.trigger('update', response.data)
})
.catch(() => {
notificationStore.danger('Error! Connection Problem!')
})
}
})