chore: add logic to add to favorite and archive

This commit is contained in:
mahyargdz
2025-07-10 12:21:12 +03:30
parent 935cc50cb1
commit a761dc1718
3 changed files with 78 additions and 0 deletions
+18
View File
@@ -145,4 +145,22 @@ export class EmailController {
deleteDraft(@UserDec("wildduckUserId") userId: string, @Param() params: MessageParamDto) {
return this.emailService.deleteDraft(userId, Number(params.messageId));
}
@Patch("messages/:messageId/archive")
@ApiOperation({ summary: "Move a message to archive mailbox" })
@ApiResponse({ status: 200, description: "Message moved to archive successfully" })
@ApiResponse({ status: 404, description: "Message not found" })
@ApiResponse({ status: 403, description: "Not authorized to move message" })
moveMessageToArchive(@UserDec("wildduckUserId") userId: string, @Param() params: MessageParamDto) {
return this.emailService.moveMessageToArchive(userId, Number(params.messageId));
}
@Patch("messages/:messageId/favorite")
@ApiOperation({ summary: "Move a message to favorite mailbox" })
@ApiResponse({ status: 200, description: "Message moved to favorite successfully" })
@ApiResponse({ status: 404, description: "Message not found" })
@ApiResponse({ status: 403, description: "Not authorized to move message" })
moveMessageToFavorite(@UserDec("wildduckUserId") userId: string, @Param() params: MessageParamDto) {
return this.emailService.moveMessageToFavorite(userId, Number(params.messageId));
}
}