diff --git a/sqle/api/controller/v1/instance_audit_plan.go b/sqle/api/controller/v1/instance_audit_plan.go index f91eb9d52..f7e93d086 100644 --- a/sqle/api/controller/v1/instance_audit_plan.go +++ b/sqle/api/controller/v1/instance_audit_plan.go @@ -109,8 +109,13 @@ func CreateInstanceAuditPlan(c echo.Context) error { return controller.JSONBaseErrorReq(c, err) } + instID, err := strconv.Atoi(req.InstanceId) + if err != nil { + return controller.JSONBaseErrorReq(c, err) + } + // check instance - inst, exist, err := dms.GetInstancesById(c.Request().Context(), req.InstanceId) + inst, exist, err := dms.GetInstanceInProjectById(c.Request().Context(), projectUid, uint64(instID)) if !exist { return controller.JSONBaseErrorReq(c, ErrInstanceNotExist) } else if err != nil {