fix: defaulting type to SYSTEM for group APIs

Signed-off-by: sharan <sharanrdude@gmail.com>
This commit is contained in:
sharan
2024-08-12 15:41:42 +05:30
parent 2dc75997bf
commit ce4b2f84b2
2 changed files with 4 additions and 1 deletions

View File

@@ -125,7 +125,7 @@ message GroupSpec {
string type = 3
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Type"
description : "Type of group"
description : "Type of group, defaults to `SYSYTEM`"
} ];
}

View File

@@ -30,6 +30,9 @@ func updateGroupStatus(req *userpbv3.Group, resp *userpbv3.Group, err error) *us
}
return req
}
if req.Spec.Type == "" {
req.Spec.Type = "SYSTEM"
}
resp.Status = &v3.Status{ConditionStatus: v3.ConditionStatus_StatusOK}
return resp
}