Added MailTypes to responses

ref #5
This commit is contained in:
2021-03-05 18:37:51 +01:00
parent 015b25a205
commit 0fa94fc867
3 changed files with 13 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
export enum MailTypes {
PASSWORD_RESET = "PASSWORD_RESET",
RUNNER_FORGOT = "RUNNER_FORGOT",
RUNNER_WELCOME = "RUNNER_WELCOME"
RUNNER_WELCOME = "RUNNER_WELCOME",
TEST = "TEST"
}

View File

@@ -1,5 +1,6 @@
import { IsBoolean, IsString } from 'class-validator';
import { locales } from './LocaleEnum';
import { MailTypes } from './MailTypeEnum';
/**
* Simple success response class to make everyone happy :)
@@ -15,7 +16,11 @@ export class SuccessResponse {
@IsString()
locale: locales;
constructor(locale?: locales) {
@IsString()
type: MailTypes;
constructor(type: MailTypes, locale?: locales) {
this.type = type;
this.locale = locale || locales.en;
}
}