mirror of
https://github.com/harness/drone.git
synced 2025-05-09 04:42:08 +08:00
Merge branch 'ap/create-status-update' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#106)
This commit is contained in:
commit
246847fbee
@ -44,6 +44,6 @@ func HandleCommentCreate(pullreqCtrl *pullreq.Controller) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
render.JSON(w, http.StatusOK, comment)
|
||||
render.JSON(w, http.StatusCreated, comment)
|
||||
}
|
||||
}
|
||||
|
@ -38,6 +38,6 @@ func HandleCreate(pullreqCtrl *pullreq.Controller) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
render.JSON(w, http.StatusOK, pr)
|
||||
render.JSON(w, http.StatusCreated, pr)
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,6 @@ func HandleCreate(repoCtrl *repo.Controller) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
render.JSON(w, http.StatusOK, repo)
|
||||
render.JSON(w, http.StatusCreated, repo)
|
||||
}
|
||||
}
|
||||
|
@ -39,6 +39,6 @@ func HandleCreateBranch(repoCtrl *repo.Controller) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
render.JSON(w, http.StatusOK, branch)
|
||||
render.JSON(w, http.StatusCreated, branch)
|
||||
}
|
||||
}
|
||||
|
@ -39,6 +39,6 @@ func HandleCreatePath(repoCtrl *repo.Controller) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
render.JSON(w, http.StatusOK, path)
|
||||
render.JSON(w, http.StatusCreated, path)
|
||||
}
|
||||
}
|
||||
|
@ -36,6 +36,6 @@ func HandleCreateCommitTag(repoCtrl *repo.Controller) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
render.JSON(w, http.StatusOK, tag)
|
||||
render.JSON(w, http.StatusCreated, tag)
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,6 @@ func HandleCreate(saCtrl *serviceaccount.Controller) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
render.JSON(w, http.StatusOK, sa)
|
||||
render.JSON(w, http.StatusCreated, sa)
|
||||
}
|
||||
}
|
||||
|
@ -38,6 +38,6 @@ func HandleCreateToken(saCrl *serviceaccount.Controller) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
render.JSON(w, http.StatusOK, tokenResponse)
|
||||
render.JSON(w, http.StatusCreated, tokenResponse)
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,6 @@ func HandleCreate(spaceCtrl *space.Controller) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
render.JSON(w, http.StatusOK, space)
|
||||
render.JSON(w, http.StatusCreated, space)
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,6 @@ func HandleCreatePath(spaceCtrl *space.Controller) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
render.JSON(w, http.StatusOK, path)
|
||||
render.JSON(w, http.StatusCreated, path)
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,6 @@ func HandleCreateAccessToken(userCtrl *user.Controller) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
render.JSON(w, http.StatusOK, tokenResponse)
|
||||
render.JSON(w, http.StatusCreated, tokenResponse)
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,6 @@ func HandleCreate(userCtrl *user.Controller) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
render.JSON(w, http.StatusOK, usr)
|
||||
render.JSON(w, http.StatusCreated, usr)
|
||||
}
|
||||
}
|
||||
|
@ -38,6 +38,6 @@ func HandleCreate(webhookCtrl *webhook.Controller) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
render.JSON(w, http.StatusOK, hook)
|
||||
render.JSON(w, http.StatusCreated, hook)
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ func buildUser(reflector *openapi3.Reflector) {
|
||||
opToken.WithTags("user")
|
||||
opToken.WithMapOfAnything(map[string]interface{}{"operationId": "createToken"})
|
||||
_ = reflector.SetRequest(&opToken, new(types.TokenResponse), http.MethodPost)
|
||||
_ = reflector.SetJSONResponse(&opToken, new(types.User), http.StatusOK)
|
||||
_ = reflector.SetJSONResponse(&opToken, new(types.User), http.StatusCreated)
|
||||
_ = reflector.SetJSONResponse(&opToken, new(usererror.Error), http.StatusInternalServerError)
|
||||
_ = reflector.Spec.AddOperation(http.MethodPost, "/user/token", opToken)
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ func buildAdmin(reflector *openapi3.Reflector) {
|
||||
opCreate.WithTags("admin")
|
||||
opCreate.WithMapOfAnything(map[string]interface{}{"operationId": "adminCreateUser"})
|
||||
_ = reflector.SetRequest(&opCreate, new(adminUsersCreateRequest), http.MethodPost)
|
||||
_ = reflector.SetJSONResponse(&opCreate, new(types.User), http.StatusOK)
|
||||
_ = reflector.SetJSONResponse(&opCreate, new(types.User), http.StatusCreated)
|
||||
_ = reflector.SetJSONResponse(&opCreate, new(usererror.Error), http.StatusBadRequest)
|
||||
_ = reflector.SetJSONResponse(&opCreate, new(usererror.Error), http.StatusInternalServerError)
|
||||
_ = reflector.SetJSONResponse(&opCreate, new(usererror.Error), http.StatusNotFound)
|
||||
|
@ -90,7 +90,7 @@ func webhookOperations(reflector *openapi3.Reflector) {
|
||||
createWebhook.WithTags("webhook")
|
||||
createWebhook.WithMapOfAnything(map[string]interface{}{"operationId": "createWebhook"})
|
||||
_ = reflector.SetRequest(&createWebhook, new(createWebhookRequest), http.MethodPost)
|
||||
_ = reflector.SetJSONResponse(&createWebhook, new(webhookType), http.StatusOK)
|
||||
_ = reflector.SetJSONResponse(&createWebhook, new(webhookType), http.StatusCreated)
|
||||
_ = reflector.SetJSONResponse(&createWebhook, new(usererror.Error), http.StatusBadRequest)
|
||||
_ = reflector.SetJSONResponse(&createWebhook, new(usererror.Error), http.StatusInternalServerError)
|
||||
_ = reflector.SetJSONResponse(&createWebhook, new(usererror.Error), http.StatusUnauthorized)
|
||||
|
Loading…
Reference in New Issue
Block a user