summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/admin
diff options
context:
space:
mode:
authorZettat123 <zettat123@gmail.com>2023-03-13 22:55:30 +0100
committerGitHub <noreply@github.com>2023-03-13 22:55:30 +0100
commit8421b8264fd7715ec93b13f37be31a945faec556 (patch)
tree891fd65121a7361480078c161970a2b597687842 /routers/api/v1/admin
parentFix missing commit status in PR which from forked repo (#23351) (diff)
downloadforgejo-8421b8264fd7715ec93b13f37be31a945faec556.tar.xz
forgejo-8421b8264fd7715ec93b13f37be31a945faec556.zip
Handle missing `README` in create repos API (#23387)
Close #22934 In `/user/repos` API (and other APIs related to creating repos), user can specify a readme template for auto init. At present, if the specified template does not exist, a `500` will be returned . This PR improved the logic and will return a `400` instead of `500`.
Diffstat (limited to 'routers/api/v1/admin')
-rw-r--r--routers/api/v1/admin/repo.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/api/v1/admin/repo.go b/routers/api/v1/admin/repo.go
index 83ed06e49b..a4895f260b 100644
--- a/routers/api/v1/admin/repo.go
+++ b/routers/api/v1/admin/repo.go
@@ -32,6 +32,8 @@ func CreateRepo(ctx *context.APIContext) {
// responses:
// "201":
// "$ref": "#/responses/Repository"
+ // "400":
+ // "$ref": "#/responses/error"
// "403":
// "$ref": "#/responses/forbidden"
// "404":