Skip to content

fix(PM-577): Return existing application if available #802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 2, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ workflows:
context : org-global
filters:
branches:
only: ['develop', 'migration-setup', 'PM-577']
only: ['develop', 'migration-setup', 'pm-577_1']
- deployProd:
context : org-global
filters:
Expand Down
44 changes: 42 additions & 2 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions src/routes/copilotOpportunityApply/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down