fix: updating a check does not require an owner id (#23034)
parent
b02c89edf6
commit
0c30afd308
|
@ -500,7 +500,7 @@ func (s *Service) updateCheck(ctx context.Context, tx kv.Tx, id platform.ID, chk
|
|||
}
|
||||
}
|
||||
|
||||
// ID and OrganizationID can not be updated
|
||||
// ID, OrganizationID, and OwnerID can not be updated.
|
||||
chk.SetID(current.GetID())
|
||||
chk.SetOrgID(current.GetOrgID())
|
||||
chk.SetOwnerID(current.GetOwnerID())
|
||||
|
|
|
@ -52,12 +52,6 @@ func (b Base) Valid(lang fluxlang.FluxLanguageService) error {
|
|||
Msg: "Check Name can't be empty",
|
||||
}
|
||||
}
|
||||
if !b.OwnerID.Valid() {
|
||||
return &errors.Error{
|
||||
Code: errors.EInvalid,
|
||||
Msg: "Check OwnerID is invalid",
|
||||
}
|
||||
}
|
||||
if !b.OrgID.Valid() {
|
||||
return &errors.Error{
|
||||
Code: errors.EInvalid,
|
||||
|
|
|
@ -65,19 +65,6 @@ func TestValidCheck(t *testing.T) {
|
|||
Msg: "Check Name can't be empty",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "invalid owner id",
|
||||
src: &check.Threshold{
|
||||
Base: check.Base{
|
||||
ID: influxTesting.MustIDBase16(id1),
|
||||
Name: "name1",
|
||||
},
|
||||
},
|
||||
err: &errors.Error{
|
||||
Code: errors.EInvalid,
|
||||
Msg: "Check OwnerID is invalid",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "invalid org id",
|
||||
src: &check.Threshold{
|
||||
|
|
Loading…
Reference in New Issue