-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add Resource Completion Status Update Endpoint for Cooperations #1005
Add Resource Completion Status Update Endpoint for Cooperations #1005
Conversation
@@ -69,17 +71,8 @@ const cooperationService = { | |||
throw createError(409, VALIDATION_ERROR('You can change only either the status or the price in one operation')) | |||
} | |||
|
|||
const cooperation = await Cooperation.findById(id).exec() | |||
if (!cooperation) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this check because we already have middleware for patch coopeation/{id} endpoint that performs the same validation, but returns a 400 error instead:
{
"status": 400,
"code": "INVALID_ID",
"message": "ID is invalid."
}
…source already found
Quality Gate passedIssues Measures |
Add Resource Completion Status Update Endpoint for student to be able to mark cooperation as 'completed' or 'active'
PR where
completionStatus
field was added to model: #966API Endpoint
PATCH /cooperations/{id}/{resourceId}/completionStatus
Changes
Previews
Successful update:
bandicam.2024-11-27.19-09-35-038.mp4
Not valid
completionStatus
error preview:An clear error message indicating that this action is restricted to the student role: