fix: improve error handling in GetUserApplication()

This commit is contained in:
Yang Luo 2024-01-30 21:40:39 +08:00
parent 8b1c4b0c75
commit 721a681ff1

View File

@ -139,6 +139,10 @@ func (c *ApiController) GetUserApplication() {
c.ResponseError(err.Error())
return
}
if application == nil {
c.ResponseError(fmt.Sprintf(c.T("general:The organization: %s should have one application at least"), user.Owner))
return
}
c.ResponseOk(object.GetMaskedApplication(application, userId))
}