chore: add logic to add to favorite and archive
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user