diff --git a/admin/db.go b/admin/db.go index af662c7..135b047 100644 --- a/admin/db.go +++ b/admin/db.go @@ -9,7 +9,6 @@ import ( ) func SearchTable(search string, table string, the_type reflect.Type, limit uint64, page uint64) ([]any, error) { - var results []any like := fmt.Sprint("%", search, "%") @@ -127,14 +126,12 @@ func Update(table string, value reflect.Value) error { // skip update of id to avoid replacing it if tag == "id" { continue } - fmt.Println(">>>>>>>>>>>>>>>>> field", tag, "=", field.Interface()) builder = builder.Set(tag, field.Interface()) } builder = builder.Where(sq.Eq{"id": value.FieldByName("Id").Interface()}) sql_query, args, err := builder.ToSql() - fmt.Println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!UPDATE QUERY", sql_query, args) if err != nil { return err} _, err = data.DB.Exec(sql_query, args...) diff --git a/common/api.go b/common/api.go index 6028589..452e850 100644 --- a/common/api.go +++ b/common/api.go @@ -48,7 +48,9 @@ func ReflectOnPost(typeOf reflect.Type, c *fiber.Ctx) (reflect.Value, error) { result_val = reflect.New(typeOf) result := result_val.Interface() - if err := c.BodyParser(result); err != nil { + if err := c.BodyParser(result) + + err != nil { log.Println(err); return result_val, err } diff --git a/data/models.go b/data/models.go index 7cfbeb9..0dbdaa9 100644 --- a/data/models.go +++ b/data/models.go @@ -8,38 +8,38 @@ type Login struct { } type User struct { - Id int `db:"id" json:"id" validate:"numeric"` + Id int `db:"id" ` Username string `db:"username" validate:"required,max=30"` Email string `db:"email" validate:"required,email,max=128"` Password string `db:"password" validate:"required,min=8,max=64"` } type Link struct { - Id int `db:"id" json:"id" validate:"isdefault"` - StreamId int `db:"stream_id" json:"stream_id" form:"stream_id" validate:"required,numeric"` - Url string `db:"url" json:"url" form:"url" validate:"required,http_url,max=150"` - Description string `db:"description" json:"description" form:"description" validate:"required,max=300"` + Id int `db:"id" ` + StreamId int `db:"stream_id" ` + Url string `db:"url" ` + Description string `db:"description" ` } type Stream struct { - Id int `db:"id" json:"id"` - Title string `db:"title" json:"title"` - Description string `db:"description" json:"description"` + Id int `db:"id" ` + Title string `db:"title" ` + Description string `db:"description" ` } type Game struct { - Id int `db:"id" json:"id"` - Slug string `db:"slug" json:"slug"` - Title string `db:"title" json:"title"` - Description string `db:"description" json:"description"` - Image string `db:"image" json:"image"` - Url string `db:"url" json:"url"` - Tags string `db:"tags" json:"tags"` - Video string `db:"video" json:"video"` - CurrentStatus string `db:"current_status" json:"current_status" form:"current_status"` - PlannedWork string `db:"planned_work" json:"planned_work" form:"planned_work"` - CodeUrl string `db:"code_url" json:"code_url" form:"code_url"` - HeaderImage string `db:"header_image" json:"header_image" form:"header_image"` + Id int `db:"id" ` + Slug string `db:"slug" ` + Title string `db:"title" ` + Description string `db:"description" ` + Image string `db:"image" ` + Url string `db:"url" ` + Tags string `db:"tags" ` + Video string `db:"video" ` + CurrentStatus string `db:"current_status" ` + PlannedWork string `db:"planned_work" ` + CodeUrl string `db:"code_url" ` + HeaderImage string `db:"header_image" ` } func Models() map[string]reflect.Type { diff --git a/pages/game/index.html b/pages/game/index.html index d534bb0..1f5f97c 100644 --- a/pages/game/index.html +++ b/pages/game/index.html @@ -11,12 +11,12 @@ diff --git a/pages/live/index.html b/pages/live/index.html index 2c2876c..6363a7f 100644 --- a/pages/live/index.html +++ b/pages/live/index.html @@ -14,8 +14,8 @@ URLDescription @@ -29,9 +29,9 @@ Submit a Link - - - + + + diff --git a/pages/login/index.html b/pages/login/index.html index 5509c18..17ad1c6 100644 --- a/pages/login/index.html +++ b/pages/login/index.html @@ -3,10 +3,10 @@

Login

- - - - + + + + diff --git a/pages/register/index.html b/pages/register/index.html index 6f4c67b..080b243 100644 --- a/pages/register/index.html +++ b/pages/register/index.html @@ -3,12 +3,12 @@

Register

- - - - - - + + + + + + diff --git a/pages/stream/index.html b/pages/stream/index.html index e8d7bf0..6f97573 100644 --- a/pages/stream/index.html +++ b/pages/stream/index.html @@ -12,9 +12,9 @@ Stream Thumbnail - -

- View This Stream + +

+ View This Stream
diff --git a/views/admin/table/contents.html b/views/admin/table/contents.html index 297e768..2284ec4 100644 --- a/views/admin/table/contents.html +++ b/views/admin/table/contents.html @@ -19,10 +19,10 @@ -