Alpha Release 0.5.0 #153

Merged
niggl merged 30 commits from dev into main 2021-03-04 16:22:40 +00:00
Showing only changes of commit 485c247cd3 - Show all commits

View File

@ -1,26 +0,0 @@
import { Authorized, JsonController, Post } from 'routing-controllers';
import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi';
import { config } from '../config';
import { Mailer } from '../mailer';
import { ResponseEmpty } from '../models/responses/ResponseEmpty';
@JsonController('/mails')
@OpenAPI({ security: [{ "AuthToken": [] }, { "RefreshTokenCookie": [] }] })
export class MailController {
private mailer: Mailer;
constructor() {
this.mailer = new Mailer();
}
@Post('/test')
@Authorized(["MAIL:CREATE"])
@ResponseSchema(ResponseEmpty, { statusCode: 200 })
@OpenAPI({ description: 'Sends a test email to the configured from-address.' })
async get() {
await this.mailer.sendTestMail(config.mail_from);
return new ResponseEmpty();
}
}