Skip to content

Commit 56b7f53

Browse files
authored
Return updated repository when changing repository using API (#16420)
1 parent d26551b commit 56b7f53

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

routers/api/v1/repo/repo.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,13 @@ func Edit(ctx *context.APIContext) {
620620
}
621621
}
622622

623-
ctx.JSON(http.StatusOK, convert.ToRepo(ctx.Repo.Repository, ctx.Repo.AccessMode))
623+
repo, err := models.GetRepositoryByID(ctx.Repo.Repository.ID)
624+
if err != nil {
625+
ctx.InternalServerError(err)
626+
return
627+
}
628+
629+
ctx.JSON(http.StatusOK, convert.ToRepo(repo, ctx.Repo.AccessMode))
624630
}
625631

626632
// updateBasicProperties updates the basic properties of a repo: Name, Description, Website and Visibility

0 commit comments

Comments
 (0)