mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-20 07:28:20 +00:00
* feat: trigger mail when user is mentioned in comment * reset email service * fix backspace issue * open comment on view comment clicked from email * add helper to highlight user in mail * reset mentioned input value when value turns empty in parent * fix test * use where condition + throw error * add userId * feat: add notification center (#3484) * remove commented code
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { Controller, Get, Body, Param, UseGuards, Patch, Query } from '@nestjs/common';
|
|
import { CommentUsersService } from '@services/comment_users.service';
|
|
import { JwtAuthGuard } from '../../src/modules/auth/jwt-auth.guard';
|
|
import { User } from 'src/decorators/user.decorator';
|
|
import { UpdateCommentUserDto } from '@dto/comment-user.dto';
|
|
|
|
@Controller('comment_notifications')
|
|
export class CommentUsersController {
|
|
constructor(private commentUsersService: CommentUsersService) {}
|
|
|
|
@UseGuards(JwtAuthGuard)
|
|
@Get()
|
|
public async index(@User() user, @Query() query) {
|
|
const notifications = await this.commentUsersService.findAll(user.id, query.isRead);
|
|
return notifications;
|
|
}
|
|
|
|
@UseGuards(JwtAuthGuard)
|
|
@Patch(':id')
|
|
public async update(@Param('id') id: string, @Body() body: UpdateCommentUserDto) {
|
|
const notification = await this.commentUsersService.update(id, body);
|
|
return notification;
|
|
}
|
|
|
|
@UseGuards(JwtAuthGuard)
|
|
@Patch()
|
|
public async updateAll(@User() user, @Body() body: UpdateCommentUserDto) {
|
|
const notifications = await this.commentUsersService.updateAll(user.id, body);
|
|
return notifications;
|
|
}
|
|
}
|