Add "Wipe Inbox" button
parent
3016f0fc34
commit
b0d9014a00
|
@ -61,6 +61,25 @@ router.get(
|
|||
}
|
||||
)
|
||||
|
||||
router.get(
|
||||
'^/:address/delete-all',
|
||||
sanitizeAddress,
|
||||
async (req, res, next) => {
|
||||
try {
|
||||
const mailProcessingService = req.app.get('mailProcessingService')
|
||||
const mailSummaries = await mailProcessingService.getMailSummaries(req.params.address)
|
||||
for (mail in mailSummaries) {
|
||||
await mailProcessingService.deleteSpecificEmail(req.params.address, mailSummaries[mail].uid)
|
||||
}
|
||||
res.redirect(`/inbox/${req.params.address}`)
|
||||
} catch (error) {
|
||||
console.error('error while deleting email', error)
|
||||
next(error)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
router.get(
|
||||
'^/:address/:uid/delete',
|
||||
sanitizeAddress,
|
||||
|
|
|
@ -7,7 +7,12 @@
|
|||
});
|
||||
</script>
|
||||
|
||||
<div style="float: right"><a href="/logout"> Logout</a></div>
|
||||
<div style="float: right; text-align: end;">
|
||||
<a href="/inbox/{{ address }}/delete-all">
|
||||
Wipe Inbox</a><br>
|
||||
<a href="/logout">
|
||||
Logout</a>
|
||||
</div>
|
||||
<h1>{{ address }}</h1>
|
||||
{% for mail in mailSummaries %}
|
||||
<a href="{{ mail.to[0] }}/{{ mail.uid }}" class="no-link-color">
|
||||
|
|
Loading…
Reference in New Issue