chore: add new funcionality for the mailboxes
This commit is contained in:
@@ -163,4 +163,31 @@ export class EmailController {
|
||||
moveMessageToFavorite(@UserDec("wildduckUserId") userId: string, @Param() params: MessageParamDto) {
|
||||
return this.emailService.moveMessageToFavorite(userId, Number(params.messageId));
|
||||
}
|
||||
|
||||
@Patch("messages/:messageId/trash")
|
||||
@ApiOperation({ summary: "Move a message to trash mailbox" })
|
||||
@ApiResponse({ status: 200, description: "Message moved to trash successfully" })
|
||||
@ApiResponse({ status: 404, description: "Message not found" })
|
||||
@ApiResponse({ status: 403, description: "Not authorized to move message" })
|
||||
moveMessageToTrash(@UserDec("wildduckUserId") userId: string, @Param() params: MessageParamDto) {
|
||||
return this.emailService.moveMessageToTrash(userId, Number(params.messageId));
|
||||
}
|
||||
|
||||
@Patch("messages/:messageId/unarchive")
|
||||
@ApiOperation({ summary: "Move a message from archive back to inbox" })
|
||||
@ApiResponse({ status: 200, description: "Message moved from archive to inbox successfully" })
|
||||
@ApiResponse({ status: 404, description: "Message not found in archive" })
|
||||
@ApiResponse({ status: 403, description: "Not authorized to move message" })
|
||||
moveMessageToInboxFromArchive(@UserDec("wildduckUserId") userId: string, @Param() params: MessageParamDto) {
|
||||
return this.emailService.moveMessageToInboxFromArchive(userId, Number(params.messageId));
|
||||
}
|
||||
|
||||
@Patch("messages/:messageId/unfavorite")
|
||||
@ApiOperation({ summary: "Move a message from favorite back to inbox" })
|
||||
@ApiResponse({ status: 200, description: "Message moved from favorite to inbox successfully" })
|
||||
@ApiResponse({ status: 404, description: "Message not found in favorite" })
|
||||
@ApiResponse({ status: 403, description: "Not authorized to move message" })
|
||||
moveMessageToInboxFromFavorite(@UserDec("wildduckUserId") userId: string, @Param() params: MessageParamDto) {
|
||||
return this.emailService.moveMessageToInboxFromFavorite(userId, Number(params.messageId));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user