From afb5a352699e4be89d0462184261f653adc640b7 Mon Sep 17 00:00:00 2001 From: Matias Date: Fri, 5 Jul 2019 17:56:55 -0300 Subject: [PATCH] Fixing clone id name --- src/schema/mutations/AddBot.js | 2 +- src/schema/mutations/RemoveBot.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/schema/mutations/AddBot.js b/src/schema/mutations/AddBot.js index d269a1d5f..a3fba7964 100644 --- a/src/schema/mutations/AddBot.js +++ b/src/schema/mutations/AddBot.js @@ -29,7 +29,7 @@ const resolve = async (parent, { bot }, context) => { if (auxProduct.codeName === bot.productCodeName) { newBotClone = { displayName: auxBot.displayName, - codeName: auxBot.codeName + '-' + bot.cloneId, + codeName: auxBot.codeName, type: auxBot.type, profilePicture: auxBot.profilePicture, cloneId: bot.cloneId, diff --git a/src/schema/mutations/RemoveBot.js b/src/schema/mutations/RemoveBot.js index a09ce89f1..68e093e27 100644 --- a/src/schema/mutations/RemoveBot.js +++ b/src/schema/mutations/RemoveBot.js @@ -23,7 +23,7 @@ const resolve = async (parent, { bot }, context) => { if (auxTeam.codeName === bot.devTeam) { for (let j = 0; j < auxTeam.bots.length; j++) { const auxBot = auxTeam.bots[j] - if (auxBot.codeName + '-' + bot.cloneId === bot.codeName) { + if (auxBot.codeName === bot.codeName && auxBot.cloneId === bot.cloneId) { for (let k = 0; k < auxBot.products.length; k++) { const auxProduct = auxBot.products[k] if (auxProduct.codeName === bot.productCodeName) {