Users: NullTime, removing transaction from insert.
This commit is contained in:
parent
950b15a117
commit
f912a434b5
4 changed files with 12 additions and 42 deletions
|
@ -15,7 +15,7 @@ type User struct {
|
|||
UserName string `json:"userName"`
|
||||
CreatedAt time.Time `db:"created_at" json:"createdAt"`
|
||||
UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
|
||||
DeletedAt time.Time `db:"deleted_at" json:"deletedAt"`
|
||||
DeletedAt NullTime `db:"deleted_at" json:"deletedAt"`
|
||||
}
|
||||
|
||||
func NewUser() *User {
|
||||
|
|
|
@ -54,7 +54,7 @@ func TestUsersService_Create(t *testing.T) {
|
|||
mux.HandleFunc(urlPath(t, router.CreateUser, nil), func(w http.ResponseWriter, r *http.Request) {
|
||||
called = true
|
||||
testMethod(t, r, "POST")
|
||||
testBody(t, r, `{"id":1,"userName":"Test User","createdAt":"0001-01-01T00:00:00Z","updatedAt":"0001-01-01T00:00:00Z","deletedAt":"0001-01-01T00:00:00Z"}`+"\n")
|
||||
testBody(t, r, `{"id":1,"userName":"Test User","createdAt":"0001-01-01T00:00:00Z","updatedAt":"0001-01-01T00:00:00Z","deletedAt":null}`+"\n")
|
||||
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
writeJSON(w, want)
|
||||
|
|
Reference in a new issue