Return error in GetProviderFromContext()

This commit is contained in:
Yang Luo
2023-06-10 15:51:26 +08:00
parent 0bda29f143
commit e0d2bc3dc9
5 changed files with 30 additions and 28 deletions

View File

@ -235,16 +235,16 @@ func GetApplicationByUser(user *User) (*Application, error) {
}
}
func GetApplicationByUserId(userId string) (application *Application, user *User, err error) {
func GetApplicationByUserId(userId string) (application *Application, err error) {
owner, name := util.GetOwnerAndNameFromId(userId)
if owner == "app" {
application, err = getApplication("admin", name)
return
}
user, err = GetUser(userId)
user, err := GetUser(userId)
if err != nil {
return nil, nil, err
return nil, err
}
application, err = GetApplicationByUser(user)
return