Add and remove clones from ecosystem

This commit is contained in:
Matias committed 2019-07-03 20:13:25 -03:00
1 parent ecf365798f
commit 5cdaca4a6d
5 files changed
+122 -7

No files matched your search

@@ -0,0 +1,35 @@
import logger from '../config/logger'
import axios from 'axios'
const removeBotMutation = async (authorization, bot) => {
logger.debug('removeBotMutation -> Entering function.')
let response = await axios({
url: process.env.GATEWAY_ENDPOINT,
method: 'post',
data: {
query: `
mutation web_RemoveBot($bot: web_BotInput){
web_RemoveBot(bot: $bot){
codeName
cloneId
}
}
`,
variables: {
bot
}
},
headers: {
authorization: authorization
}
})
if (response.data.errors) {
throw response.data.errors
}
return response.data.data.web_RemoveBot
}
export default removeBotMutation