mirror of
https://gitlab.com/mobicoop/v3/service/ad.git
synced 2026-01-03 08:22:41 +00:00
fix / refactoring
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -22,7 +22,7 @@ export function hasProperPassengerSeats(args: ValidationArguments) {
|
||||
return true;
|
||||
else return false;
|
||||
}
|
||||
/* istanbul ignore next */
|
||||
|
||||
export function HasProperPassengerSeats(
|
||||
validationOptions?: ValidationOptions,
|
||||
): PropertyDecorator {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user