From 94ad247f963c88700cc2ed4d703b3d05bff4e581 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Thu, 9 Feb 2023 14:02:04 +0200 Subject: [PATCH] fix(sdbapi): name fields correctly in JSON --- sdbapi/models/game.go | 6 +++--- sdbapi/models/user.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdbapi/models/game.go b/sdbapi/models/game.go index 3064adb..c2c0081 100644 --- a/sdbapi/models/game.go +++ b/sdbapi/models/game.go @@ -23,9 +23,9 @@ const ( type Game struct { ID string `json:"id" gorm:"primarykey;type:uuid;default:gen_random_uuid()"` - CreatedAt time.Time - UpdatedAt time.Time - DeletedAt gorm.DeletedAt `gorm:"index"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"` P1 string `json:"p1" gorm:"foreignkey:ID"` P2 string `json:"p2" gorm:"foreignkey:ID"` State uint8 `json:"state" gorm:"type:smallint"` diff --git a/sdbapi/models/user.go b/sdbapi/models/user.go index a98d88e..0594488 100644 --- a/sdbapi/models/user.go +++ b/sdbapi/models/user.go @@ -17,9 +17,9 @@ import ( type User struct { ID string `json:"id" gorm:"primarykey;type:uuid;default:gen_random_uuid()"` - CreatedAt time.Time - UpdatedAt time.Time - DeletedAt gorm.DeletedAt `gorm:"index"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"` Username string `json:"username" gorm:"unique"` Email string `json:"email" gorm:"unique"` Password string `json:"password"` -- 2.44.1