Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 7efc43c

Browse files
author
noah
committed
Set the format UTC at the store pkg
1 parent 941813f commit 7efc43c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

internal/pkg/store/deployment.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ func (s *Store) SearchDeploymentsOfUser(ctx context.Context, u *ent.User, opt *i
4343
deployment.And(
4444
deployment.UserIDEQ(u.ID),
4545
statusIn(opt.Statuses),
46-
deployment.CreatedAtGTE(opt.From),
47-
deployment.CreatedAtLT(opt.To),
46+
deployment.CreatedAtGTE(opt.From.UTC()),
47+
deployment.CreatedAtLT(opt.To.UTC()),
4848
),
4949
).
5050
Order(ent.Desc(deployment.FieldCreatedAt)).
@@ -70,8 +70,8 @@ func (s *Store) SearchDeploymentsOfUser(ctx context.Context, u *ent.User, opt *i
7070
Where(
7171
deployment.And(
7272
statusIn(opt.Statuses),
73-
deployment.CreatedAtGTE(opt.From),
74-
deployment.CreatedAtLT(opt.To),
73+
deployment.CreatedAtGTE(opt.From.UTC()),
74+
deployment.CreatedAtLT(opt.To.UTC()),
7575
),
7676
).
7777
Order(ent.Desc(deployment.FieldCreatedAt)).

internal/server/api/v1/search/search.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ func (s *Search) SearchDeployments(c *gin.Context) {
115115
ListOptions: i.ListOptions{Page: p, PerPage: pp},
116116
Statuses: ss,
117117
Owned: o,
118-
From: f.UTC(),
119-
To: t.UTC(),
118+
From: f,
119+
To: t,
120120
}); err != nil {
121121
s.log.Check(gb.GetZapLogLevel(err), "Failed to search deployments.").Write(zap.Error(err))
122122
gb.ResponseWithError(c, err)

0 commit comments

Comments
 (0)