Skip to content

Conversation

@ShravyaKudlu
Copy link

@ShravyaKudlu ShravyaKudlu commented Jan 11, 2026

Description

Fixes #1897

Related PRS (if any):

This backend pr is related to #1897

Main changes explained:

There are 2 models

StudentGroup → represents a group of students, e.g., Math or Science.

  • Has educator_id, name, description.
  • One document = one group.

StudentGroupMember → represents a student being in a group.

  • Has group_id → links to a StudentGroup.
  • Has student_id → links to a UserProfile (student).
  • One document = one student in one group.
  • Prevents duplicates with a unique index on (group_id + student_id).

Commits

  • fix(1342): adjust backend logic
  • fix: update models
  • fix: update controllers
  • fix: update routes
  • fix: Modified model for a bugfix related to put/post request
  • fix: modified to controller to match the model
  • fix: controller for addmembers and delete members

Routes:

groups

POST /groups → you can create a new group
GET /groups → Gets all groups currently present
PUT /groups/:groupId → updates the group in case of anything
DELETE /groups/:groupId → deletes the specified group

group members

GET /groups/:groupId/members → gets all the students from the mentioned group
POST /groups/:groupId/members → adds studentID's to the group
DELETE /groups/:groupId/members → deletes studentID's from the group

All students

GET /students → Get all students, role = student

How to test:

  1. check into current branch
  2. do npm install and npm run dev to run this PR locally
  3. Clear site data/cache
  4. Loggin as Admin or educator and copy the token for all your tests
  5. Follow the video

Screenshots or videos of changes:

test.mp4

Note:

Please Make your own user with educator role.
Test edge cases

@ShravyaKudlu ShravyaKudlu marked this pull request as ready for review January 11, 2026 06:40
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