js Validating promises

The solution for “js Validating promises” can be found here. The following code will assist you in solving the problem.

// If your object contains property with Promise-returned
// value that should be validated, then you need to use
// the @ValidatePromise() decorator:

import { ValidatePromise, Min } from ‘class-validator’;

export class Post {
@Min(0)
@ValidatePromise()
userId: Promise;
}

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in