Updated apiers by adding tenant default value in apier/v2

This commit is contained in:
porosnicuadrian
2020-10-15 16:59:00 +03:00
committed by Dan Christian Bogos
parent 010a7e92c7
commit 5baaeba5a8
2 changed files with 10 additions and 7 deletions

View File

@@ -33,9 +33,12 @@ type AttributeWithCache struct {
//SetAttributeProfile add/update a new Attribute Profile
func (APIerSv2 *APIerSv2) SetAttributeProfile(arg *AttributeWithCache, reply *string) error {
if missing := utils.MissingStructFields(arg.ExternalAttributeProfile, []string{utils.Tenant, utils.ID}); len(missing) != 0 {
if missing := utils.MissingStructFields(arg.ExternalAttributeProfile, []string{utils.ID}); len(missing) != 0 {
return utils.NewErrMandatoryIeMissing(missing...)
}
if arg.Tenant == utils.EmptyString {
arg.Tenant = APIerSv2.Config.GeneralCfg().DefaultTenant
}
alsPrf, err := arg.ExternalAttributeProfile.AsAttributeProfile()
if err != nil {
return utils.APIErrorHandler(err)