Skip to content

Commit

Permalink
generate integration id if not any (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikmel2803 authored Aug 25, 2021
1 parent 2dd99d2 commit 9bc3a36
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/resolvers/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9bc3a36

Please sign in to comment.