diff --git a/.circleci/config.yml b/.circleci/config.yml index 3dd6a457..1acd4a4c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -149,7 +149,7 @@ workflows: context : org-global filters: branches: - only: ['develop', 'migration-setup', 'PM-577'] + only: ['develop', 'migration-setup'] - deployProd: context : org-global filters: diff --git a/docs/swagger.yaml b/docs/swagger.yaml index e38fbe25..dbadf9e6 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -487,9 +487,9 @@ paths: $ref: "#/definitions/ApplyCopilotOpportunity" responses: "200": - description: "The copilot opportunity" + description: "The copilot opportunity application" schema: - $ref: "#/definitions/CopilotOpportunity" + $ref: "#/definitions/CopilotOpportunityApplication" "401": description: "Unauthorized" schema: @@ -6013,6 +6013,46 @@ definitions: format: int64 description: READ-ONLY. User that last updated this task readOnly: true + CopilotOpportunityApplication: + type: object + properties: + id: + description: unique identifier + type: integer + format: int64 + notes: + description: notes regarding the application + type: string + opportunityId: + description: copilot request id + type: integer + createdAt: + type: string + description: Datetime (GMT) when task was created + readOnly: true + createdBy: + type: integer + format: int64 + description: READ-ONLY. User who created this task + readOnly: true + updatedAt: + type: string + description: READ-ONLY. Datetime (GMT) when task was updated + readOnly: true + updatedBy: + type: integer + format: int64 + description: READ-ONLY. User that last updated this task + readOnly: true + deletedAt: + type: string + description: READ-ONLY. Datetime (GMT) when task was deleted + readOnly: true + deletedBy: + type: integer + format: int64 + description: READ-ONLY. User that deleted this task + readOnly: true Project: type: object properties: diff --git a/src/routes/copilotOpportunityApply/create.js b/src/routes/copilotOpportunityApply/create.js index dcf2cbe5..0093a217 100644 --- a/src/routes/copilotOpportunityApply/create.js +++ b/src/routes/copilotOpportunityApply/create.js @@ -60,9 +60,8 @@ module.exports = [ }); if (existingApplication) { - const err = new Error('User already applied for this opportunity'); - err.status = 400; - return next(err); + res.status(200).json(existingApplication); + return Promise.resolve(); } return models.CopilotApplication.create(data)