mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 10:48:15 +08:00
modified deleteApp and createService judgment logic
This commit is contained in:
parent
1812db6690
commit
2694181922
@ -650,8 +650,12 @@ func (t *TenantStruct) CreateService(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
// Check if the application ID exists
|
||||
if ss.AppID == "" {
|
||||
httputil.ReturnError(r, w, 404, "create must set correct app_id ,can't find application")
|
||||
return
|
||||
}
|
||||
_, err := handler.GetTenantApplicationHandler().GetAppByID(ss.AppID)
|
||||
if err != nil || ss.AppID == "" {
|
||||
if err != nil {
|
||||
if err.Error() == gorm.ErrRecordNotFound.Error() {
|
||||
httputil.ReturnError(r, w, 404, "create must set correct app_id ,can't find application")
|
||||
return
|
||||
|
@ -77,9 +77,5 @@ func (a *TenantApplicationAction) GetAppByID(appID string) (*dbmodel.Application
|
||||
|
||||
// DeleteApp -
|
||||
func (a *TenantApplicationAction) DeleteApp(appID string) error {
|
||||
err := db.GetManager().TenantApplicationDao().DeleteApp(appID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return db.GetManager().TenantApplicationDao().DeleteApp(appID)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user