Skip to content

onboarding backend - #1056

Closed
ethanransing wants to merge 6 commits into
mainfrom
ethan-onboarding
Closed

ethanransing wants to merge 6 commits into
mainfrom
ethan-onboarding

Conversation

@ethanransing

Copy link
Copy Markdown
Contributor

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25fd43a27b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +59 to +64
try {
// Create new comment in MongoDB
await CommentModel.create({
courseId,
createdBy: context.user._id,
text: text.trim(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate courseId to avoid 500s on bad input

If a client passes an empty/whitespace courseId, Mongoose will raise a validation error (schema requires non-empty strings after trim), but the catch block converts that into a generic INTERNAL_SERVER_ERROR. This turns a user-input problem into a 500 and makes it hard to diagnose. Consider validating courseId similarly to text and returning BAD_USER_INPUT so clients get a proper error instead of a server error.

Useful? React with 👍 / 👎.

@ARtheboss ARtheboss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pretty nice code

Comment thread packages/gql-typedefs/discussion.ts Outdated
Comment on lines +8 to +17
"Unique identifier"
_id: ID!
"Course identifier"
courseId: String!
"User ID who created the comment"
createdBy: String!
"Comment text content"
text: String!
"Timestamp when comment was created"
createdAt: String!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These comments are probably not necessary, pretty self-explanatory

@ARtheboss ARtheboss closed this Feb 18, 2026
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.

2 participants