Skip to content

Conversation

@Harish-Naruto
Copy link
Member

@Harish-Naruto Harish-Naruto commented Jul 27, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Corrected a typo in the PATCH endpoint URL for toggling question completion to ensure proper functionality.
  • Documentation

    • Updated API documentation for deleting topics to simplify the success response, now showing only a confirmation message and status.

…on object documentation in topics route and removed vitest and mocha from bun lock
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 27, 2025

Walkthrough

This update corrects a typo in the route parameter for the PATCH endpoint in the progress routes and revises the API documentation for the DELETE topic endpoint by simplifying the success response details. No changes were made to logic, error handling, or exported entities.

Changes

File(s) Change Summary
src/routes/progress.ts Fixed typo in PATCH endpoint route parameter from :memeberId to :memberId.
src/routes/topics.ts Removed detailed question object fields from DELETE /topics/:topicId success response docs.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • Routes/topics #7: Adds new controller and route modules including progress and topics routes and controllers; related by involving the same route files but does not address typo or documentation changes.

Poem

A typo fixed, a doc made neat,
Progress and topics now complete.
No logic changed, just words refined,
For future readers, peace of mind.
🐇✨

With every patch, the code grows bright—
Hop along, all bugs take flight!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-bunlock

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Harish-Naruto Harish-Naruto changed the title fix: correct memberId typo in progress route ,remove redundant question object documentation in topics route and removed vitest and mocha from bun lock fix: remove vitest and mocha from bun lock Jul 27, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/routes/topics.ts (1)

89-89: Nit – extra double-space before “Response status”
Minor formatting hitch: "status Response status." has two spaces.

- * @apiSuccess {String="SUCCESS"} status  Response status.
+ * @apiSuccess {String="SUCCESS"} status Response status.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 06b2167 and 2867f46.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • src/routes/progress.ts (1 hunks)
  • src/routes/topics.ts (1 hunks)
🔇 Additional comments (1)
src/routes/progress.ts (1)

41-42: Confirm external usages and documentation
A repository-wide search for the old :memeberId parameter returned no matches (rg --glob '!dist' ':memeberId'), so there are no stale references within the codebase. However, please manually verify that all external consumers are updated to the new :memberId spelling to avoid unexpected 404s:

  • API clients or SDKs
  • Integration and end-to-end tests
  • API documentation (e.g., OpenAPI/Swagger specs, README examples)

Comment on lines 88 to +90
* @apiSuccess {String} message Confirmation message
* @apiSuccess {String="SUCCESS"} status Response status.
* @apiSuccess {Object} question question object.
* @apiSuccess {Number} question.id Question ID.
* @apiSuccess {String} question.questionName Name of the question.
* @apiSuccess {String} question.link Link to the question.
* @apiSuccess {String="Easy","Medium","Hard"} question.difficulty Difficulty level of the question.
* @apiSuccess {Number} question.topicId Topic ID associated with the question.
* @apiSuccess {number} question.createdAt Timestamp when the question was created.
* @apiSuccess {number} question.updatedAt Timestamp when the question was last updated.
* @apiSuccess {String} question.createdById ID of the user who created the question.
* @apiSuccess {String} question.updatedById ID of the user who last updated the question.
*
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Success response no longer documents question object – ensure handler matches
The docs now advertise only { message, status }, but the controller may still be returning the deleted topic (or an empty object). Mismatched docs → client confusion. Double-check deleteTopic’s actual return shape and update either the docs or implementation.


🏁 Script executed:

#!/bin/bash
# Locate the deleteTopic handler and inspect its response shape
rg -n "deleteTopic" src/routes/topics.ts
rg -n -A 10 "deleteTopic" src/routes/topics.ts

Length of output: 1216


🏁 Script executed:

#!/bin/bash
# Find and display the implementation of deleteTopic in the topic controller
rg -n "deleteTopic" -A 20 src/controllers/topic.controller.ts

Length of output: 390


Mismatch between docs and deleteTopic response
The deleteTopic controller (src/controllers/topic.controller.ts lines 47–50) only returns:

res.status(200).json({
  status: "SUCCESS",
});

but the API docs in src/routes/topics.ts (lines 88–90) still declare a message field:

- * @apiSuccess {String} message Confirmation message
  * @apiSuccess {String="SUCCESS"} status  Response status.

Please choose one of the following fixes:

  • Remove the @apiSuccess {String} message line from the docs, or
  • Extend the controller response to include a message property (e.g.
    res.status(200).json({ status: "SUCCESS", message: "Topic deleted successfully" });
    ```)
🤖 Prompt for AI Agents
In src/routes/topics.ts around lines 88 to 90, the API documentation declares a
message field in the deleteTopic response, but the actual controller response in
src/controllers/topic.controller.ts lines 47 to 50 does not include this
message. To fix this, either remove the @apiSuccess {String} message line from
the docs to match the current response, or update the deleteTopic controller to
include a message property in the JSON response, such as { status: "SUCCESS",
message: "Topic deleted successfully" }.

@i-am-that-guy i-am-that-guy merged commit 3f50c0b into main Jul 27, 2025
2 checks passed
@i-am-that-guy i-am-that-guy deleted the update-bunlock branch July 27, 2025 10:49
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