mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-20 19:09:07 +01:00
put Where before Find
This commit is contained in:
parent
0ffff2c994
commit
9c2e580ab5
@ -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 New Issue
Block a user