feat: phase1 platform upgrade with moderation, dev payments, admin panel and landing updates
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Controller, Post, Get, Param, Body } from '@nestjs/common';
|
||||
import { Controller, Post, Get, Param, Body, Query } from '@nestjs/common';
|
||||
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { GroupsService } from './groups.service';
|
||||
import { CurrentUser } from '../auth/decorators/current-user.decorator';
|
||||
@ -31,13 +31,21 @@ export class GroupsController {
|
||||
}
|
||||
|
||||
@Get(':groupId/messages')
|
||||
async getMessages(@Param('groupId') groupId: string, @CurrentUser() user: User): Promise<any> {
|
||||
return this.groupsService.getGroupMessages(groupId, user.id);
|
||||
async getMessages(
|
||||
@Param('groupId') groupId: string,
|
||||
@Query('lessonId') lessonId: string | undefined,
|
||||
@CurrentUser() user: User
|
||||
): Promise<any> {
|
||||
return this.groupsService.getGroupMessages(groupId, user.id, lessonId);
|
||||
}
|
||||
|
||||
@Post(':groupId/messages')
|
||||
async sendMessage(@Param('groupId') groupId: string, @Body('content') content: string, @CurrentUser() user: User): Promise<any> {
|
||||
return this.groupsService.sendMessage(groupId, user.id, content);
|
||||
async sendMessage(
|
||||
@Param('groupId') groupId: string,
|
||||
@Body() body: { content: string; lessonId?: string },
|
||||
@CurrentUser() user: User
|
||||
): Promise<any> {
|
||||
return this.groupsService.sendMessage(groupId, user.id, body.content, body.lessonId);
|
||||
}
|
||||
|
||||
@Post(':groupId/invite-link')
|
||||
|
||||
Reference in New Issue
Block a user