Files
alexis/lib/components/network/proxy.js
2023-08-01 12:47:58 +02:00

21 lines
617 B
JavaScript

'use strict'
const {receivedNetwork} = require('./actions')
module.exports = {
// urls that should be called for the remote actions
urls: {
fetch: 'https://layla.amazon.de/api/phoenix',
discover: 'https://layla.amazon.de/api/phoenix/discovery',
},
// called after an remote http call to the network API has been successfully executed
postHooks: {
// called after the network data has been fetched
fetch: (store, data) => {
return new Promise((resolve, reject) => {
store.dispatch(receivedNetwork(JSON.parse(data.networkDetail)))
resolve(data)
})
}
}
}