Add comment to updatemachine

This commit is contained in:
Kristoffer Dalby 2021-08-23 07:35:44 +01:00
parent 0aeeaac361
commit ebd27b46af
No known key found for this signature in database
GPG key ID: 09F62DC067465735

View file

@ -213,6 +213,8 @@ func (h *Headscale) GetMachineByID(id uint64) (*Machine, error) {
return &m, nil return &m, nil
} }
// UpdateMachine takes a Machine struct pointer (typically already loaded from database
// and updates it with the latest data from the database.
func (h *Headscale) UpdateMachine(m *Machine) error { func (h *Headscale) UpdateMachine(m *Machine) error {
if result := h.db.Find(m).First(&m); result.Error != nil { if result := h.db.Find(m).First(&m); result.Error != nil {
return result.Error return result.Error