Added success response
This commit is contained in:
		@@ -1,3 +1,4 @@
 | 
			
		||||
import { IsString } from 'class-validator';
 | 
			
		||||
import { Authorized, JsonController, Post, QueryParam } from 'routing-controllers';
 | 
			
		||||
import { OpenAPI } from 'routing-controllers-openapi';
 | 
			
		||||
import { Mailer } from '../Mailer';
 | 
			
		||||
@@ -24,7 +25,7 @@ export class MailController {
 | 
			
		||||
        } catch (error) {
 | 
			
		||||
            throw error;
 | 
			
		||||
        }
 | 
			
		||||
        return;
 | 
			
		||||
        return new SuccessResponse();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Post('/test')
 | 
			
		||||
@@ -40,6 +41,18 @@ export class MailController {
 | 
			
		||||
            console.log(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!"
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user