mirror of
https://github.com/juanfont/headscale.git
synced 2026-10-30 18:24:06 +09:00
Preload namespace so the name can be shown
This commit is contained in:
1 parent
7287e0259c
commit
7ce4738d8a
2 files changed
+7
-3
No files matched your search
+1
-1
@@ -231,7 +231,7 @@ func (h *Headscale) GetMachine(namespace string, name string) (*Machine, error)
|
||||
// GetMachineByID finds a Machine by ID and returns the Machine struct
|
||||
func (h *Headscale) GetMachineByID(id uint64) (*Machine, error) {
|
||||
m := Machine{}
|
||||
if result := h.db.Find(&Machine{ID: id}).First(&m); result.Error != nil {
|
||||
if result := h.db.Preload("Namespace").Find(&Machine{ID: id}).First(&m); result.Error != nil {
|
||||
return nil, result.Error
|
||||
}
|
||||
return &m, nil
|
||||
|
||||
Reference in new issue
Block a user