Skip to content

Commit

Permalink
fix: exam title valdiation
Browse files Browse the repository at this point in the history
  • Loading branch information
ISNewton committed Oct 13, 2024
1 parent f469c17 commit 8248449
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion .env

This file was deleted.

2 changes: 2 additions & 0 deletions .example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DATABASE_URL=postgres://username:password@localhost:5432/database_name
APP_PORT=4000
4 changes: 2 additions & 2 deletions cmd/api/exam_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (config *Config) createExam(c echo.Context) error {
var examSchema types.ExamInput

rules := govalidator.MapData{
"exam_title": []string{"required", "min:4", "max:30"},
"exam_title": []string{"required", "min:4", "max:255"},
"status": []string{"required", "in:public,private"},
"questions": []string{"required"},
}
Expand Down Expand Up @@ -639,7 +639,7 @@ func (config *Config) checkExamTitle(c echo.Context) error {
var examSchema types.ExamInput

rules := govalidator.MapData{
"exam_title": []string{"required", "min:4", "max:30"},
"exam_title": []string{"required", "min:4", "max:255"},
}

opts := govalidator.Options{
Expand Down
4 changes: 3 additions & 1 deletion cmd/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,7 @@ func main() {

registerApiRoutes(e, config)

e.Logger.Fatal(e.Start(":4000"))
appPort := os.Getenv("APP_PORT")

e.Logger.Fatal(e.Start(":" + appPort))
}
1 change: 0 additions & 1 deletion example.env

This file was deleted.

0 comments on commit 8248449

Please sign in to comment.