chore: add new funcionality for the mailboxes

This commit is contained in:
mahyargdz
2025-07-12 11:36:48 +03:30
parent 344bf1de0a
commit 24e315ff46
11 changed files with 291 additions and 91 deletions
+27
View File
@@ -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));
}
}