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')
async createAd(data: CreateAdRequest): Promise<AdPresenter> {
console.log('controler');
console.log(data);
try {
const ad = await this._commandBus.execute(new CreateAdCommand(data));
return this._mapper.map(ad, Ad, AdPresenter);

View File

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

View File

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

View File

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