Skip to content

Commit

Permalink
Refactor GroupRegistrationController API to retrieve current group me…
Browse files Browse the repository at this point in the history
…mbership (#1675)
  • Loading branch information
scmet committed Jul 3, 2024
1 parent 31dd1ba commit 12b7242
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import de.thm.ii.fbs.services.security.AuthService

import javax.servlet.http.{HttpServletRequest, HttpServletResponse}
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.http.MediaType
import org.springframework.http.{MediaType, ResponseEntity}
import org.springframework.web.bind.annotation._

/**
Expand Down Expand Up @@ -142,4 +142,17 @@ class GroupRegistrationController {
throw new ForbiddenException()
}
}

/**
* Get current number of members of a group
*
* @param cid Course id
* @param gid Group id
* @return Number of members
*/
@GetMapping(Array("/courses/{cid}/groups/{gid}/membership"))
def getGroupMembership(@PathVariable("cid") cid: Integer, @PathVariable("gid") gid: Int): ResponseEntity[Int] = {
val membership = groupRegistrationService.getGroupMembership(cid, gid)
ResponseEntity.ok(membership)
}
}

0 comments on commit 12b7242

Please sign in to comment.