From 9bc3a36fc55d9441754d9831070e89887e27084d Mon Sep 17 00:00:00 2001 From: Nikita Melnikov Date: Wed, 25 Aug 2021 18:15:42 +0300 Subject: [PATCH] generate integration id if not any (#360) --- src/resolvers/project.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/resolvers/project.js b/src/resolvers/project.js index 61691ea7..bb7e7d43 100644 --- a/src/resolvers/project.js +++ b/src/resolvers/project.js @@ -149,11 +149,14 @@ module.exports = { throw new ApolloError('There is no project with that id:', id); } - const encodedIntegrationToken = ProjectModel.generateIntegrationToken(project.integrationId); + const integrationId = project.integrationId || ProjectModel.generateIntegrationId(); + + const encodedIntegrationToken = ProjectModel.generateIntegrationToken(integrationId); try { const updatedProject = await project.updateProject({ token: encodedIntegrationToken, + integrationId, }); return {