1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Updates to the API for archived repos (#27149)

This commit is contained in:
JakobDev
2023-09-22 01:43:29 +02:00
committed by GitHub
parent 7520cd678c
commit 28f9b313ba
22 changed files with 249 additions and 34 deletions

View File

@@ -282,6 +282,8 @@ func CreatePullRequest(ctx *context.APIContext) {
// "$ref": "#/responses/error"
// "422":
// "$ref": "#/responses/validationError"
// "423":
// "$ref": "#/responses/repoArchivedError"
form := *web.GetForm(ctx).(*api.CreatePullRequestOption)
if form.Head == form.Base {
@@ -741,6 +743,8 @@ func MergePullRequest(ctx *context.APIContext) {
// "$ref": "#/responses/empty"
// "409":
// "$ref": "#/responses/error"
// "423":
// "$ref": "#/responses/repoArchivedError"
form := web.GetForm(ctx).(*forms.MergePullRequestForm)
@@ -1196,6 +1200,8 @@ func CancelScheduledAutoMerge(ctx *context.APIContext) {
// "$ref": "#/responses/forbidden"
// "404":
// "$ref": "#/responses/notFound"
// "423":
// "$ref": "#/responses/repoArchivedError"
pullIndex := ctx.ParamsInt64(":index")
pull, err := issues_model.GetPullRequestByIndex(ctx, ctx.Repo.Repository.ID, pullIndex)