My response after registration looks as follows:
{
"emailAddress": "test@test.com",
"id": 43,
"uuid": "afb9fd83-b989-40c6-bb81-210e053fe19a",
"createdAt": "2021-07-29T03:13:29.427Z",
"updatedAt": "2021-07-29T03:13:29.427Z"
"user": {
"id": 43,
"uuid": "588cef19-bbaa-4a91-905e-088d9098a1aa",
"firstName": "dadadada2",
"createdAt": "2021-07-29T03:13:29.427Z",
"updatedAt": "2021-07-29T03:13:29.427Z",
},
}
But that does not agree with my DTO class. I would like to get a result:
{
"firstName": "dadadada2",
"id": 43,
"uuid": "588cef19-bbaa-4a91-905e-088d9098a1aa",
"createdAt": "2021-07-29T03:13:29.427Z",
"updatedAt": "2021-07-29T03:13:29.427Z",
"authentication": {
"emailAddress": "test@test.com",
"id": 43,
"uuid": "afb9fd83-b989-40c6-bb81-210e053fe19a",
"createdAt": "2021-07-29T03:13:29.427Z",
"updatedAt": "2021-07-29T03:13:29.427Z"
}
}
I tried to combine with types and the Partial method in Typescript, but then I would have to use the word any - and I want to avoid this.
How to write functions in JS, who will turn it back?