We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Every time I attempt to convert req.body using plainToInstance, it adds a field id:"".
req.body
plainToInstance
id:""
Minimal code-snippet showcasing the problem
export class Note { @Exclude() id = ''; @Expose() title = ''; @Expose() content = ''; author = ''; @Expose() sharedUsers: SharedUsers[] = []; createdAt?: Date; updatedAt?: Date; } const noteInputDto = plainToInstance(Note, req.body, { excludeExtraneousValues: true });
{ "title":"test", "content":"test", "sharedUsers":[] }
{ "id": "", "title": "test", "content": "test", "sharedUsers": [] }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
Every time I attempt to convert
req.body
usingplainToInstance
, it adds a fieldid:""
.Minimal code-snippet showcasing the problem
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: