Error due to Date when I try to update a DB record
Hello everybody!
I have a really weird issue and I don't understand:
I have created a Postgres DB record with this code:
And since here everything is fine.
When I am going to update my record, I would like to do something like:
But I am receiving this error
I think I know what is the problem cause I have encountered it before, when I tried to save the
I think that now, when I am spreading my
My DB schema for those two Dates is:
Why I am receiving that error? It seems like something broken is happening behind the scenes.
Thanks for the help!
I have a really weird issue and I don't understand:
I have created a Postgres DB record with this code:
And since here everything is fine.
When I am going to update my record, I would like to do something like:
But I am receiving this error
TypeError: value.toISOString is not a function.I think I know what is the problem cause I have encountered it before, when I tried to save the
createdAt an updatedAt from the request body from the front end, passing them new Date() as values.I think that now, when I am spreading my
...data I have a createdAt field inside of it that causes me that error, but it has no sense! My DB schema for those two Dates is:
Why I am receiving that error? It seems like something broken is happening behind the scenes.
Thanks for the help!