Skip to content

Commit

Permalink
fix unused query param
Browse files Browse the repository at this point in the history
  • Loading branch information
NOOBDY committed Nov 29, 2024
1 parent 6192b17 commit 7eb9d1d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions api/grade.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ func RegisterGrade(e *echo.Group) {
})

type PostSubmitRequest struct {
DisableCheck string `query:"disable_check,omitempty"`
StudentId string `json:"student_id"`
HomeworkName string `json:"homework_name"`
Semester string `json:"semester"`
Expand All @@ -185,7 +184,7 @@ func RegisterGrade(e *echo.Group) {
return echo.NewHTTPError(http.StatusBadRequest, errors.Unwrap(err))
}

disableCheck := data.DisableCheck == "1"
disableCheck := c.QueryParam("disable_check") == "1"

if data.StudentId == "" {
return echo.NewHTTPError(http.StatusBadRequest, "student_id required")
Expand Down

0 comments on commit 7eb9d1d

Please sign in to comment.