mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 19:57:42 +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
|
// 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)
|
_, err := handler.GetTenantApplicationHandler().GetAppByID(ss.AppID)
|
||||||
if err != nil || ss.AppID == "" {
|
if err != nil {
|
||||||
if err.Error() == gorm.ErrRecordNotFound.Error() {
|
if err.Error() == gorm.ErrRecordNotFound.Error() {
|
||||||
httputil.ReturnError(r, w, 404, "create must set correct app_id ,can't find application")
|
httputil.ReturnError(r, w, 404, "create must set correct app_id ,can't find application")
|
||||||
return
|
return
|
||||||
|
@ -77,9 +77,5 @@ func (a *TenantApplicationAction) GetAppByID(appID string) (*dbmodel.Application
|
|||||||
|
|
||||||
// DeleteApp -
|
// DeleteApp -
|
||||||
func (a *TenantApplicationAction) DeleteApp(appID string) error {
|
func (a *TenantApplicationAction) DeleteApp(appID string) error {
|
||||||
err := db.GetManager().TenantApplicationDao().DeleteApp(appID)
|
return db.GetManager().TenantApplicationDao().DeleteApp(appID)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user