You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!DtoClass) {
throw new Error(
`You need to use @UseDto on class (${this.constructor.name}) be able to call toDto function`,
);
}
return new DtoClass(this, options);
Actual, we don't need to define private dtoClass?: Constructor<DTO, [AbstractEntity, O?]>; in abstract.entity.ts. Just remove it and make a change in toDto method.
toDto(options?: O): DTO
{
const dtoClass = Object.getPrototypeOf(this).dtoClass;
if (!dtoClass) {
throw new Error(
`You need to use @UseDto on class (${this.constructor.name}) be able to call toDto function`,
);
}
return new dtoClass(this, options);
// use-dto.decorator.ts
The ctor.prototype.dtoClass always undefined.
The text was updated successfully, but these errors were encountered: