mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-15 18:05:50 +01:00
Change group repository creation API endpoint to /orgs/:org/repos
This commit is contained in:
@@ -402,8 +402,8 @@ trait AccountControllerBase extends AccountManagementControllerBase {
|
||||
* Create group repository
|
||||
* https://developer.github.com/v3/repos/#create
|
||||
*/
|
||||
post("/api/v3/groups/:groupName/repos")(managersOnly {
|
||||
val groupName = params("groupName")
|
||||
post("/api/v3/orgs/:org/repos")(managersOnly {
|
||||
val groupName = params("org")
|
||||
(for {
|
||||
data <- extractFromJsonBody[CreateARepository] if data.isValid
|
||||
} yield {
|
||||
|
||||
@@ -65,7 +65,7 @@ object Implicits {
|
||||
|
||||
def paths: Array[String] = (request.getRequestURI.substring(request.getContextPath.length + 1) match{
|
||||
case path if path.startsWith("api/v3/repos/") => path.substring(13/* "/api/v3/repos".length */)
|
||||
case path if path.startsWith("api/v3/groups/") => path.substring(14/* "/api/v3/groups".length */)
|
||||
case path if path.startsWith("api/v3/orgs/") => path.substring(12/* "/api/v3/orgs".length */)
|
||||
case path => path
|
||||
}).split("/")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user