Compare commits

...

3 commits

Author SHA1 Message Date
541d0fce27 fix: ftime now set to now() if not received in backend
All checks were successful
Build and Deploy Go App / build (push) Successful in 9m7s
Build and Deploy Go App / deploy (push) Successful in 1m6s
2025-12-06 09:55:42 +03:00
4102aa20d2 Merge branch 'dev' of ssh://meowgit.nekoea.red:22222/nihonium/nyanimedb into dev 2025-12-06 09:53:06 +03:00
103a872be2 fix 2025-12-06 09:53:02 +03:00

View file

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