Skip to content

Conversation

@ecrupper
Copy link
Contributor

This refactor is an effort to eliminate several Get requests 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.

@ecrupper ecrupper self-assigned this May 25, 2023
@ecrupper ecrupper requested a review from a team as a code owner May 25, 2023 17:08
@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Merging #861 (1dd12b5) into main (5f5bfe3) will increase coverage by 0.01%.
The diff coverage is 61.53%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
api/webhook.go 0.00% <0.00%> (ø)
database/hook/create.go 85.71% <80.00%> (ø)
database/hook/update.go 85.71% <80.00%> (ø)

Copy link
Member

@cognifloyd cognifloyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Straight forward improvement

Copy link
Contributor

@jbrockopp jbrockopp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@plyr4 plyr4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants