feat: add save to paperless and send email functionality to inbox detail page with tiptap editor integration
Build and Push Multi-Platform Images / build-and-push (push) Successful in 46s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 46s
This commit is contained in:
@@ -175,4 +175,38 @@ export class InboxController {
|
||||
const preferredUsername: string | null = req.user?.preferredUsername ?? null;
|
||||
await this.inboxService.updateSource(id, body.source, preferredUsername);
|
||||
}
|
||||
|
||||
@Post(':id/save-to-paperless')
|
||||
@HttpCode(204)
|
||||
async saveToPaperless(
|
||||
@Param('id') id: string,
|
||||
@Body() body: {
|
||||
title: string;
|
||||
date?: string;
|
||||
documentTypeId?: number;
|
||||
correspondentId?: number;
|
||||
tagIds?: number[];
|
||||
},
|
||||
@Request() req: any,
|
||||
): Promise<void> {
|
||||
const preferredUsername: string | null = req.user?.preferredUsername ?? null;
|
||||
await this.inboxService.saveToPaperless(id, preferredUsername, body);
|
||||
}
|
||||
|
||||
@Post(':id/send-email')
|
||||
@HttpCode(204)
|
||||
async sendEmail(
|
||||
@Param('id') id: string,
|
||||
@Body() body: {
|
||||
to: string;
|
||||
subject: string;
|
||||
body: string;
|
||||
html?: string;
|
||||
filename?: string;
|
||||
},
|
||||
@Request() req: any,
|
||||
): Promise<void> {
|
||||
const preferredUsername: string | null = req.user?.preferredUsername ?? null;
|
||||
await this.inboxService.sendAsEmail(id, preferredUsername, body);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user