Delete and Create User working

This commit is contained in:
2018-11-15 19:23:53 +01:00
parent c19f60f565
commit 40ac601c2d
4 changed files with 102 additions and 44 deletions

View File

@ -54,6 +54,15 @@ func GetUserCompanyMapByEmail(o orm.Ormer, email string) (v *UserCompanyMap, err
return nil, err
}
// GetUserCompanyMapByEmail retrieves UserCompanyMap by email. Returns error if email doesn't exist
func GetUserCompanyMapByCompanyAndCID(o orm.Ormer, company string, companyUserID int16) (v *UserCompanyMap, err error) {
v = &UserCompanyMap{}
if o.QueryTable(v.TableName()).Filter("company", company).Filter("company_user_id", companyUserID).One(v); err == nil {
return v, nil
}
return nil, err
}
// GetAllUserCompanyMap retrieves all UserCompanyMap matches certain condition. Returns empty list if
// no records exist
func GetAllUserCompanyMap(o orm.Ormer, query map[string]string, fields []string, sortby []string, order []string,