Skip to content

Commit

Permalink
Fix push mirror, wrong timestamp format
Browse files Browse the repository at this point in the history
  • Loading branch information
kilimnik committed Sep 20, 2023
1 parent 9336286 commit 584f9f9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
18 changes: 10 additions & 8 deletions modules/structs/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

package structs

import "time"

// CreatePushMirrorOption represents need information to create a push mirror of a repository.
type CreatePushMirrorOption struct {
RemoteAddress string `json:"remote_address"`
Expand All @@ -15,12 +17,12 @@ type CreatePushMirrorOption struct {
// PushMirror represents information of a push mirror
// swagger:model
type PushMirror struct {
RepoName string `json:"repo_name"`
RemoteName string `json:"remote_name"`
RemoteAddress string `json:"remote_address"`
CreatedUnix string `json:"created"`
LastUpdateUnix string `json:"last_update"`
LastError string `json:"last_error"`
Interval string `json:"interval"`
SyncOnCommit bool `json:"sync_on_commit"`
RepoName string `json:"repo_name"`
RemoteName string `json:"remote_name"`
RemoteAddress string `json:"remote_address"`
CreatedUnix time.Time `json:"created"`
LastUpdateUnix time.Time `json:"last_update"`
LastError string `json:"last_error"`
Interval string `json:"interval"`
SyncOnCommit bool `json:"sync_on_commit"`
}
4 changes: 2 additions & 2 deletions services/convert/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.AsTime(),
LastError: pm.LastError,
Interval: pm.Interval.String(),
SyncOnCommit: pm.SyncOnCommit,
Expand Down
2 changes: 2 additions & 0 deletions templates/swagger/v1_json.tmpl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 584f9f9

Please sign in to comment.