diff options
author | Daniel Kilimnik <mail@kilimnik.de> | 2023-09-23 14:15:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-23 12:15:05 +0000 |
commit | 0ee7cbf725f45650136be45f8e0f74d395f73b5c (patch) | |
tree | 90545bec038a6395732c5a91516570d59f613c24 /services/convert | |
parent | 5f7388e586d4aa53e6689a0faa962ee26e5509cf (diff) | |
download | gitea-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.go | 4 |
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, |