Skip to content

BE_16#47

Merged
notjackl3 merged 1 commit intomainfrom
BE_16
Feb 25, 2026
Merged

BE_16#47
notjackl3 merged 1 commit intomainfrom
BE_16

Conversation

@notjackl3
Copy link
Copy Markdown
Collaborator

Implements the POST /api/sessions endpoint that allows professors to create semester-long Q&A sessions for their courses. The endpoint validates professor enrollment, auto-generates a unique 6-character join code, and creates the session with SCHEDULED status. Includes rate limiting and error handling for authorization and validation failures.

Notes: The current implementation of code generation is using Math.random() which is needed to complete this ticket. However, in BE_17, we will implement crypto-secure randomInt() for the actual code generation process.

Copy link
Copy Markdown
Collaborator

@1elasmarjad 1elasmarjad left a comment

Choose a reason for hiding this comment

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

Looks good! 1 comment

Comment thread src/lib/sessionService.ts
data: {
courseId,
createdById: userId,
title: title.trim(),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should we also validate that the title is not empty? or within a reasonable length limit

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It is already validated using validateSessionTitle() in sessionValidation.ts!

@notjackl3 notjackl3 merged commit cb889dd into main Feb 25, 2026
2 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.

2 participants