Skip to content

Conversation

@icy-r
Copy link
Member

@icy-r icy-r commented Nov 29, 2025

This pull request introduces a new bulk update feature for question status, refines validation and error handling, and makes minor improvements to existing logic. The most significant change is the addition of an endpoint and service logic to enable or disable all questions at once. Other updates include improved validation for settings and user verification, and minor code quality enhancements.

Bulk question status update:

  • Added bulkUpdateStatus controller and corresponding service (bulkUpdateQuestionStatus) to enable/disable all questions at once (src/controllers/question.js, src/services/question.js, src/repository/question/index.js, src/routes/question.routes.js, src/validations/question.js). [1] [2] [3] [4] [5] [6] [7] [8]
  • Added new route PATCH /questions/bulk/status for admins, with schema validation (bulkUpdateStatusSchema) for the enabled field (src/routes/question.routes.js, src/validations/question.js). [1] [2]

Validation and error handling improvements:

  • Improved the resendVerification controller to throw a 404 error if the user is not found (src/controllers/auth.js).
  • Updated settings patch route to validate only the request body, not params, and fixed the controller to accept and pass the request body to the update logic (src/routes/setting.routes.js, src/controllers/settings.js). [1] [2]

Minor code quality and bug fixes:

  • Fixed logic in leaderboard name generation to ensure unique names are always added (src/services/leaderboard.js).
  • Removed unused pick import from lodash in src/app.js.
  • Fixed user creation error handling by removing unnecessary .exec() call (src/services/user.js).
  • Removed unnecessary upsert option in submission grading update (src/repository/submission.js).

@icy-r icy-r self-assigned this Nov 29, 2025
@vercel
Copy link

vercel bot commented Nov 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
bashaway-backend Ignored Ignored Nov 29, 2025 1:18pm

@icy-r icy-r requested a review from Akalanka47000 November 29, 2025 08:35
@Akalanka47000 Akalanka47000 changed the base branch from main to development November 29, 2025 13:19
@Akalanka47000
Copy link
Member

Changes look good @icy-r . I updated the path of the bulk update endpoint and also added creator lock into it. Merging now and testing in staging before release

await sendUserPassword(payload.email, generatedPassword, payload.role);
return newUser;
} catch (e) {
findOneAndRemoveUser({ email: payload.email }).exec();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@icy-r this will not run without the exec call. This returns a query instance which we must either await or use exec on to actually execute the query

@Akalanka47000 Akalanka47000 merged commit 69ffeed into development Nov 29, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants