your message
This commit is contained in:
@ -16,8 +16,18 @@ export class GroupsController {
|
||||
}
|
||||
|
||||
@Post(':groupId/members')
|
||||
async addMember(@Param('groupId') groupId: string, @Body('userId') userId: string): Promise<any> {
|
||||
return this.groupsService.addMember(groupId, userId);
|
||||
async addMember(@Param('groupId') groupId: string, @Body('userId') userId: string, @CurrentUser() user: User): Promise<any> {
|
||||
return this.groupsService.addMember(groupId, user.id, userId);
|
||||
}
|
||||
|
||||
@Get('course/:courseId/default')
|
||||
async getDefaultGroup(@Param('courseId') courseId: string, @CurrentUser() user: User): Promise<any> {
|
||||
return this.groupsService.getDefaultGroup(courseId, user.id);
|
||||
}
|
||||
|
||||
@Get(':groupId/members')
|
||||
async getMembers(@Param('groupId') groupId: string, @CurrentUser() user: User): Promise<any> {
|
||||
return this.groupsService.getGroupMembers(groupId, user.id);
|
||||
}
|
||||
|
||||
@Get(':groupId/messages')
|
||||
@ -29,4 +39,14 @@ export class GroupsController {
|
||||
async sendMessage(@Param('groupId') groupId: string, @Body('content') content: string, @CurrentUser() user: User): Promise<any> {
|
||||
return this.groupsService.sendMessage(groupId, user.id, content);
|
||||
}
|
||||
|
||||
@Post(':groupId/invite-link')
|
||||
async createInviteLink(@Param('groupId') groupId: string, @CurrentUser() user: User): Promise<any> {
|
||||
return this.groupsService.createInviteLink(groupId, user.id);
|
||||
}
|
||||
|
||||
@Post('join/:groupId')
|
||||
async joinByInvite(@Param('groupId') groupId: string, @CurrentUser() user: User): Promise<any> {
|
||||
return this.groupsService.joinByInvite(groupId, user.id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user