Replace convert.To with APIFormat calls
This commit is contained in:
parent
3f7f4852ef
commit
dccb0c15b9
21 changed files with 79 additions and 225 deletions
|
@ -482,28 +482,6 @@ func (repo *Repository) SavePatch(index int64, patch []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ComposePayload composes and returns *api.PayloadRepo corresponding to the repository.
|
||||
func (repo *Repository) ComposePayload() *api.PayloadRepo {
|
||||
cl := repo.CloneLink()
|
||||
return &api.PayloadRepo{
|
||||
ID: repo.ID,
|
||||
Name: repo.Name,
|
||||
URL: repo.FullLink(),
|
||||
SSHURL: cl.SSH,
|
||||
CloneURL: cl.HTTPS,
|
||||
Description: repo.Description,
|
||||
Website: repo.Website,
|
||||
Watchers: repo.NumWatches,
|
||||
Owner: &api.PayloadAuthor{
|
||||
Name: repo.MustOwner().DisplayName(),
|
||||
Email: repo.MustOwner().Email,
|
||||
UserName: repo.MustOwner().Name,
|
||||
},
|
||||
Private: repo.IsPrivate,
|
||||
DefaultBranch: repo.DefaultBranch,
|
||||
}
|
||||
}
|
||||
|
||||
func isRepositoryExist(e Engine, u *User, repoName string) (bool, error) {
|
||||
has, err := e.Get(&Repository{
|
||||
OwnerID: u.ID,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue