Skip to content

Commit

Permalink
put Where before Find
Browse files Browse the repository at this point in the history
  • Loading branch information
caelansar authored and juanfont committed Jan 20, 2023
1 parent 0ffff2c commit 9c2e580
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ func (h *Headscale) ListMachines() ([]Machine, error) {

func (h *Headscale) ListMachinesByGivenName(givenName string) ([]Machine, error) {
machines := []Machine{}
if err := h.db.Preload("AuthKey").Preload("AuthKey.User").Preload("User").Find(&machines).Where("given_name = ?", givenName).Error; err != nil {
if err := h.db.Preload("AuthKey").Preload("AuthKey.User").Preload("User").Where("given_name = ?", givenName).Find(&machines).Error; err != nil {
return nil, err
}

Expand Down

0 comments on commit 9c2e580

Please sign in to comment.