mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-22 01:34:18 +00:00
Renamed ctx.User to ctx.Doer. (#19161)
Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
5495ba7660
commit
80fd25524e
129 changed files with 881 additions and 881 deletions
|
@ -63,7 +63,7 @@ func GetStarredRepos(ctx *context.APIContext) {
|
|||
// "$ref": "#/responses/RepositoryList"
|
||||
|
||||
user := GetUserByParams(ctx)
|
||||
private := user.ID == ctx.User.ID
|
||||
private := user.ID == ctx.Doer.ID
|
||||
repos, err := getStarredRepos(user, private, utils.GetListOptions(ctx))
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "getStarredRepos", err)
|
||||
|
@ -94,12 +94,12 @@ func GetMyStarredRepos(ctx *context.APIContext) {
|
|||
// "200":
|
||||
// "$ref": "#/responses/RepositoryList"
|
||||
|
||||
repos, err := getStarredRepos(ctx.User, true, utils.GetListOptions(ctx))
|
||||
repos, err := getStarredRepos(ctx.Doer, true, utils.GetListOptions(ctx))
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "getStarredRepos", err)
|
||||
}
|
||||
|
||||
ctx.SetTotalCountHeader(int64(ctx.User.NumStars))
|
||||
ctx.SetTotalCountHeader(int64(ctx.Doer.NumStars))
|
||||
ctx.JSON(http.StatusOK, &repos)
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ func IsStarring(ctx *context.APIContext) {
|
|||
// "404":
|
||||
// "$ref": "#/responses/notFound"
|
||||
|
||||
if repo_model.IsStaring(ctx.User.ID, ctx.Repo.Repository.ID) {
|
||||
if repo_model.IsStaring(ctx.Doer.ID, ctx.Repo.Repository.ID) {
|
||||
ctx.Status(http.StatusNoContent)
|
||||
} else {
|
||||
ctx.NotFound()
|
||||
|
@ -152,7 +152,7 @@ func Star(ctx *context.APIContext) {
|
|||
// "204":
|
||||
// "$ref": "#/responses/empty"
|
||||
|
||||
err := repo_model.StarRepo(ctx.User.ID, ctx.Repo.Repository.ID, true)
|
||||
err := repo_model.StarRepo(ctx.Doer.ID, ctx.Repo.Repository.ID, true)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "StarRepo", err)
|
||||
return
|
||||
|
@ -180,7 +180,7 @@ func Unstar(ctx *context.APIContext) {
|
|||
// "204":
|
||||
// "$ref": "#/responses/empty"
|
||||
|
||||
err := repo_model.StarRepo(ctx.User.ID, ctx.Repo.Repository.ID, false)
|
||||
err := repo_model.StarRepo(ctx.Doer.ID, ctx.Repo.Repository.ID, false)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "StarRepo", err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue