mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-09 20:14:58 +02:00
chore: fix repo watch (#38921)
This commit is contained in:
1 parent
56ad4689ad
commit
5e4d21acd5
26 files changed
+156
-137
No files matched your search
@@ -132,7 +132,7 @@ func IsWatching(ctx *context.APIContext) {
|
||||
// "404":
|
||||
// description: User is not watching this repo or repo do not exist
|
||||
|
||||
if repo_model.IsWatching(ctx, ctx.Doer.ID, ctx.Repo.Repository.ID) {
|
||||
if repo_model.IsWatchingRepo(ctx, ctx.Doer.ID, ctx.Repo.Repository.ID) {
|
||||
ctx.JSON(http.StatusOK, api.WatchInfo{
|
||||
Subscribed: true,
|
||||
Ignored: false,
|
||||
@@ -170,7 +170,7 @@ func Watch(ctx *context.APIContext) {
|
||||
// "404":
|
||||
// "$ref": "#/responses/notFound"
|
||||
|
||||
err := repo_model.WatchRepo(ctx, ctx.Doer, ctx.Repo.Repository, true)
|
||||
err := repo_model.WatchRepoAuto(ctx, ctx.Doer, ctx.Repo.Repository, true)
|
||||
if err != nil {
|
||||
if errors.Is(err, user_model.ErrBlockedUser) {
|
||||
ctx.APIError(http.StatusForbidden, err.Error())
|
||||
@@ -211,7 +211,7 @@ func Unwatch(ctx *context.APIContext) {
|
||||
// "404":
|
||||
// "$ref": "#/responses/notFound"
|
||||
|
||||
err := repo_model.WatchRepo(ctx, ctx.Doer, ctx.Repo.Repository, false)
|
||||
err := repo_model.WatchRepoAuto(ctx, ctx.Doer, ctx.Repo.Repository, false)
|
||||
if err != nil {
|
||||
ctx.APIErrorInternal(err)
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user