mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-02 03:33:05 +00:00
put Where before Find
This commit is contained in:
parent
0ffff2c994
commit
9c2e580ab5
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue