Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: support /users/:username/repos #1059

Merged
merged 1 commit into from
Feb 27, 2017
Merged

Conversation

awwalker
Copy link
Contributor

Fix for half of: #494. I'm not 100% sure about the movement of functions and files and defer to you but I thought this grouping made sense.

@@ -284,6 +285,9 @@ func RegisterRoutes(m *macaron.Macaron) {
Delete(user.DeletePublicKey)
})

m.Combo("/repos", reqToken()).Get(user.ListMyRepos).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reqToken() isn't required here; it is already included on line 301.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks.

@ethantkoenig
Copy link
Member

One small tweak, otherwise LGTM

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Feb 25, 2017

import (
api "code.gitea.io/sdk/gitea"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove empty line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

// listUserRepos - List the repositories owned by the given user.
func listUserRepos(ctx *context.APIContext, u *models.User) {
userID := u.ID
showPrivateRepos := ctx.User.ID == userID && ctx.IsSigned
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ctx.User.ID == userID || ctx.User.IsAdmin) && ctx.IsSigned

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Good catch.

@lunny lunny added the modifies/api This PR adds API routes or modifies them label Feb 26, 2017
@lunny lunny added this to the 1.2.0 milestone Feb 26, 2017
@appleboy
Copy link
Member

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 26, 2017
clean up

fix arguments

remove repeated token

give admins listing rights
@bkcsoft
Copy link
Member

bkcsoft commented Feb 27, 2017

LGTM

@bkcsoft bkcsoft merged commit c0f99e8 into go-gitea:master Feb 27, 2017
@lunny lunny modified the milestones: 1.1.0, 1.2.0 Feb 27, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants