parent
ba71c55492
commit
6c676c4869
|
@ -77,10 +77,13 @@ func (c *Client) ListMachines() ([]*ent.Machine, error) {
|
|||
}
|
||||
|
||||
func (c *Client) ValidateMachine(machineID string) error {
|
||||
_, err := c.Ent.Machine.Update().Where(machine.MachineIdEQ(machineID)).SetIsValidated(true).Save(c.CTX)
|
||||
rets, err := c.Ent.Machine.Update().Where(machine.MachineIdEQ(machineID)).SetIsValidated(true).Save(c.CTX)
|
||||
if err != nil {
|
||||
return errors.Wrapf(UpdateFail, "validating machine: %s", err)
|
||||
}
|
||||
if rets == 0 {
|
||||
return fmt.Errorf("machine not found")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue