aboutsummaryrefslogtreecommitdiffstats
path: root/services/convert
diff options
context:
space:
mode:
authorDaniel Kilimnik <mail@kilimnik.de>2023-09-23 14:15:05 +0200
committerGitHub <noreply@github.com>2023-09-23 12:15:05 +0000
commit0ee7cbf725f45650136be45f8e0f74d395f73b5c (patch)
tree90545bec038a6395732c5a91516570d59f613c24 /services/convert
parent5f7388e586d4aa53e6689a0faa962ee26e5509cf (diff)
downloadgitea-0ee7cbf725f45650136be45f8e0f74d395f73b5c.tar.gz
gitea-0ee7cbf725f45650136be45f8e0f74d395f73b5c.zip
Fix push mirror, wrong timestamp format (#27153)
I noticed, that the push mirrors endpoint, is the only endpoint which returns the times in long format rather than as time.Time(). I think the behavior should be consistent across the project. ---- ## ⚠️ BREAKING ⚠️ This PR changes the time format used in API responses for all push_mirror endpoints which return a push mirror. --------- Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'services/convert')
-rw-r--r--services/convert/mirror.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/convert/mirror.go b/services/convert/mirror.go
index 5051104526..dade6142a2 100644
--- a/services/convert/mirror.go
+++ b/services/convert/mirror.go
@@ -15,8 +15,8 @@ func ToPushMirror(pm *repo_model.PushMirror) (*api.PushMirror, error) {
RepoName: repo.Name,
RemoteName: pm.RemoteName,
RemoteAddress: pm.RemoteAddress,
- CreatedUnix: pm.CreatedUnix.FormatLong(),
- LastUpdateUnix: pm.LastUpdateUnix.FormatLong(),
+ CreatedUnix: pm.CreatedUnix.AsTime(),
+ LastUpdateUnix: pm.LastUpdateUnix.AsTimePtr(),
LastError: pm.LastError,
Interval: pm.Interval.String(),
SyncOnCommit: pm.SyncOnCommit,