-
Notifications
You must be signed in to change notification settings - Fork 30
refactor(db): return hook created or updated #861
New issue
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #861 +/- ##
==========================================
+ Coverage 66.12% 66.13% +0.01%
==========================================
Files 297 297
Lines 13879 13876 -3
==========================================
Hits 9177 9177
+ Misses 4255 4252 -3
Partials 447 447
|
cognifloyd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Straight forward improvement
jbrockopp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
plyr4
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
This refactor is an effort to eliminate several
Getrequests to the DB immediately after creating or updating a resource. Fortunately, with Gorm's create and save methods, the object is populated with any fields that are generated upon DB insertion (ID namely). In other words, we can safely return the object we use for these operations.