perf: add database indexes, implement caching, enforce permission guards, and sanitize external URLs
Build and Push Multi-Platform Images / build-and-push (push) Successful in 48s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 48s
This commit is contained in:
@@ -21,6 +21,7 @@ export class EmailController {
|
||||
) {}
|
||||
|
||||
@Get()
|
||||
@RequirePermissions(Permission.VIEW_MAIL)
|
||||
async getEmails(
|
||||
@Query('status') status?: string,
|
||||
@Query('limit') limit?: string,
|
||||
@@ -38,6 +39,7 @@ export class EmailController {
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
@RequirePermissions(Permission.VIEW_MAIL)
|
||||
async getEmail(@Param('id') id: string) {
|
||||
return this.emailRepo.findOneOrFail({
|
||||
where: { Id: parseInt(id, 10) },
|
||||
@@ -46,6 +48,7 @@ export class EmailController {
|
||||
}
|
||||
|
||||
@Get(':id/attachments')
|
||||
@RequirePermissions(Permission.VIEW_MAIL)
|
||||
async getAttachments(@Param('id') id: string) {
|
||||
return this.attachmentRepo.find({
|
||||
where: { EmailMessageId: parseInt(id, 10) },
|
||||
@@ -54,6 +57,7 @@ export class EmailController {
|
||||
}
|
||||
|
||||
@Get('attachments/:attachmentId/content')
|
||||
@RequirePermissions(Permission.VIEW_MAIL)
|
||||
async getAttachmentContent(
|
||||
@Param('attachmentId') attachmentId: string,
|
||||
@Res() res: Response,
|
||||
|
||||
Reference in New Issue
Block a user