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
I am trying to update a record in the database using the document's ID to identify it. If the update is successful, I expect an to get back the updated record and send it back via a REST API. If the update fails due to the record not being in the database (i.e. the ID was not found), I expect to get a gorm.ErrRecordNotFound
I was expecting to get a gorm.ErrRecordNotFound but no error is being produced. Even if I make updates using an ID that is way out of range I am still getting back something. If I do make an update to a record that I know exists in the database, it is working but I'm not getting back the updated record on t. I thought this would be the case since I am passing &t to this. Am I doing something wrong with these updates? Please help.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has been open 360 days with no activity. Remove stale label or comment or this will be closed in 180 days
Question
I am trying to update a record in the database using the document's ID to identify it. If the update is successful, I expect an to get back the updated record and send it back via a REST API. If the update fails due to the record not being in the database (i.e. the ID was not found), I expect to get a
gorm.ErrRecordNotFound
This is the code I am using to do the update.
I was expecting to get a
gorm.ErrRecordNotFound
but no error is being produced. Even if I make updates using an ID that is way out of range I am still getting back something. If I do make an update to a record that I know exists in the database, it is working but I'm not getting back the updated record ont
. I thought this would be the case since I am passing&t
to this. Am I doing something wrong with these updates? Please help.The text was updated successfully, but these errors were encountered: