fix / refactoring

This commit is contained in:
Grégoire Chevalier 2023-05-31 09:09:58 +02:00
parent 8ddf19df55
commit 1b5ed98ee5
4 changed files with 4 additions and 9 deletions

View File

@ -41,8 +41,6 @@ export class AdController {
@GrpcMethod('AdsService', 'Create') @GrpcMethod('AdsService', 'Create')
async createAd(data: CreateAdRequest): Promise<AdPresenter> { async createAd(data: CreateAdRequest): Promise<AdPresenter> {
console.log('controler');
console.log(data);
try { try {
const ad = await this._commandBus.execute(new CreateAdCommand(data)); const ad = await this._commandBus.execute(new CreateAdCommand(data));
return this._mapper.map(ad, Ad, AdPresenter); return this._mapper.map(ad, Ad, AdPresenter);

View File

@ -11,7 +11,7 @@ export function hasProperDriverSeats(args: ValidationArguments) {
typeof args.object['seatsDriver'] === 'number' typeof args.object['seatsDriver'] === 'number'
) )
return args.object['seatsDriver'] > 0; return args.object['seatsDriver'] > 0;
else if ( if (
(args.object['driver'] === false || (args.object['driver'] === false ||
args.object['driver'] === null || args.object['driver'] === null ||
args.object['driver'] === undefined) && args.object['driver'] === undefined) &&
@ -20,9 +20,9 @@ export function hasProperDriverSeats(args: ValidationArguments) {
args.object['seatsDriver'] === undefined) args.object['seatsDriver'] === undefined)
) )
return true; return true;
else return false; return false;
} }
/* istanbul ignore next */
export function HasProperDriverSeats( export function HasProperDriverSeats(
validationOptions?: ValidationOptions, validationOptions?: ValidationOptions,
): PropertyDecorator { ): PropertyDecorator {

View File

@ -22,7 +22,7 @@ export function hasProperPassengerSeats(args: ValidationArguments) {
return true; return true;
else return false; else return false;
} }
/* istanbul ignore next */
export function HasProperPassengerSeats( export function HasProperPassengerSeats(
validationOptions?: ValidationOptions, validationOptions?: ValidationOptions,
): PropertyDecorator { ): PropertyDecorator {

View File

@ -28,12 +28,9 @@ function isRecurrent(args: ValidationArguments): boolean {
} }
export const isPunctualOrRecurrent = (args: ValidationArguments): boolean => { export const isPunctualOrRecurrent = (args: ValidationArguments): boolean => {
console.log('validator ');
console.log(args.object);
return isPunctual(args) || isRecurrent(args); return isPunctual(args) || isRecurrent(args);
}; };
/* istanbul ignore next */
export function IsPunctualOrRecurrent( export function IsPunctualOrRecurrent(
validationOptions?: ValidationOptions, validationOptions?: ValidationOptions,
): PropertyDecorator { ): PropertyDecorator {