Compare commits

..

No commits in common. "541d0fce2704d39aa7ec7aea0987d3ac5d7af694" and "dfd3bb5f48ea75aac526edd78221c33787a06c78" have entirely different histories.

View file

@ -71,10 +71,7 @@ func sqlDate2oapi(p_date pgtype.Timestamptz) *time.Time {
func oapiDate2sql(t *time.Time) pgtype.Timestamptz { func oapiDate2sql(t *time.Time) pgtype.Timestamptz {
if t == nil { if t == nil {
return pgtype.Timestamptz{ return pgtype.Timestamptz{Valid: false}
Time: time.Now(),
Valid: true,
}
} }
return pgtype.Timestamptz{ return pgtype.Timestamptz{
Time: *t, Time: *t,
@ -389,9 +386,6 @@ func (s Server) AddUserTitle(ctx context.Context, request oapi.AddUserTitleReque
// fmt.Println(pgErr.Code) // => 42601 // fmt.Println(pgErr.Code) // => 42601
if pgErr.Code == pgErrDuplicateKey { //duplicate key value if pgErr.Code == pgErrDuplicateKey { //duplicate key value
return oapi.AddUserTitle409Response{}, nil return oapi.AddUserTitle409Response{}, nil
} else {
log.Errorf("%v", err)
return oapi.AddUserTitle500Response{}, nil
} }
} else { } else {
log.Errorf("%v", err) log.Errorf("%v", err)