Fixed result form stuff

This commit is contained in:
Gregory Ballantine 2024-05-29 11:43:17 -04:00
parent 0525838f4b
commit 7282d0a4b6
3 changed files with 8 additions and 8 deletions

View File

@ -1,9 +1,9 @@
package forms
type ResultForm struct {
Test uint `form:"result_test" validate:"required"`
Hardware uint `form:"result_hardware" validate:"required"`
Benchmark uint `form:"result_benchmark" validate:"required"`
Test int `form:"result_test" validate:"required"`
Hardware int `form:"result_hardware" validate:"required"`
Benchmark int `form:"result_benchmark" validate:"required"`
AverageScore float32 `form:"result_avg" validate:"required"`
MinimumScore float32 `form:"result_min"`
MaximumScore float32 `form:"result_max"`

View File

@ -56,6 +56,6 @@ func RegisterRoutes(f *flamego.Flame) {
// result routes
f.Group("/result", func() {
f.Post("/add", routes.ResultPostCreate)
f.Post("/add", binding.Form(forms.ResultForm{}), routes.ResultPostCreate)
})
}

View File

@ -11,7 +11,7 @@ import (
"git.metaunix.net/bitgoblin/blt/web/forms"
)
func TestPostCreate(c flamego.Context, form forms.ResultForm, errs binding.Errors) {
func ResultPostCreate(c flamego.Context, form forms.ResultForm, errs binding.Errors) {
if len(errs) > 0 {
var err error
switch errs[0].Category {