Added success response

This commit is contained in:
Nicolai Ort 2021-03-02 17:20:08 +01:00
parent f8b9b188ae
commit 895e346e59

View File

@ -1,3 +1,4 @@
import { IsString } from 'class-validator';
import { Authorized, JsonController, Post, QueryParam } from 'routing-controllers'; import { Authorized, JsonController, Post, QueryParam } from 'routing-controllers';
import { OpenAPI } from 'routing-controllers-openapi'; import { OpenAPI } from 'routing-controllers-openapi';
import { Mailer } from '../Mailer'; import { Mailer } from '../Mailer';
@ -24,7 +25,7 @@ export class MailController {
} catch (error) { } catch (error) {
throw error; throw error;
} }
return; return new SuccessResponse();
} }
@Post('/test') @Post('/test')
@ -40,6 +41,18 @@ export class MailController {
console.log(error) console.log(error)
throw error; throw error;
} }
return; return new SuccessResponse();
} }
} }
/**
* Simple success response class to make everyone happy :)
*/
export class SuccessResponse {
@IsString()
success: boolean = true;
@IsString()
message: "Sent!"
}