Skip to content

Commit

Permalink
fix: ceate instances of audit tasks that are filtered by project
Browse files Browse the repository at this point in the history
  • Loading branch information
iwanghc committed Nov 22, 2024
1 parent 8245ec3 commit 4ff0b17
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sqle/api/controller/v1/instance_audit_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4ff0b17

Please sign in to comment.