Merge branch 'ap/create-status-update' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#106)

This commit is contained in:
Akhilesh Pandey 2023-06-01 09:40:49 +00:00 committed by Harness
commit 246847fbee
16 changed files with 16 additions and 16 deletions

View File

@ -44,6 +44,6 @@ func HandleCommentCreate(pullreqCtrl *pullreq.Controller) http.HandlerFunc {
return
}
render.JSON(w, http.StatusOK, comment)
render.JSON(w, http.StatusCreated, comment)
}
}

View File

@ -38,6 +38,6 @@ func HandleCreate(pullreqCtrl *pullreq.Controller) http.HandlerFunc {
return
}
render.JSON(w, http.StatusOK, pr)
render.JSON(w, http.StatusCreated, pr)
}
}

View File

@ -32,6 +32,6 @@ func HandleCreate(repoCtrl *repo.Controller) http.HandlerFunc {
return
}
render.JSON(w, http.StatusOK, repo)
render.JSON(w, http.StatusCreated, repo)
}
}

View File

@ -39,6 +39,6 @@ func HandleCreateBranch(repoCtrl *repo.Controller) http.HandlerFunc {
return
}
render.JSON(w, http.StatusOK, branch)
render.JSON(w, http.StatusCreated, branch)
}
}

View File

@ -39,6 +39,6 @@ func HandleCreatePath(repoCtrl *repo.Controller) http.HandlerFunc {
return
}
render.JSON(w, http.StatusOK, path)
render.JSON(w, http.StatusCreated, path)
}
}

View File

@ -36,6 +36,6 @@ func HandleCreateCommitTag(repoCtrl *repo.Controller) http.HandlerFunc {
return
}
render.JSON(w, http.StatusOK, tag)
render.JSON(w, http.StatusCreated, tag)
}
}

View File

@ -34,6 +34,6 @@ func HandleCreate(saCtrl *serviceaccount.Controller) http.HandlerFunc {
return
}
render.JSON(w, http.StatusOK, sa)
render.JSON(w, http.StatusCreated, sa)
}
}

View File

@ -38,6 +38,6 @@ func HandleCreateToken(saCrl *serviceaccount.Controller) http.HandlerFunc {
return
}
render.JSON(w, http.StatusOK, tokenResponse)
render.JSON(w, http.StatusCreated, tokenResponse)
}
}

View File

@ -32,6 +32,6 @@ func HandleCreate(spaceCtrl *space.Controller) http.HandlerFunc {
return
}
render.JSON(w, http.StatusOK, space)
render.JSON(w, http.StatusCreated, space)
}
}

View File

@ -37,6 +37,6 @@ func HandleCreatePath(spaceCtrl *space.Controller) http.HandlerFunc {
return
}
render.JSON(w, http.StatusOK, path)
render.JSON(w, http.StatusCreated, path)
}
}

View File

@ -34,6 +34,6 @@ func HandleCreateAccessToken(userCtrl *user.Controller) http.HandlerFunc {
return
}
render.JSON(w, http.StatusOK, tokenResponse)
render.JSON(w, http.StatusCreated, tokenResponse)
}
}

View File

@ -33,6 +33,6 @@ func HandleCreate(userCtrl *user.Controller) http.HandlerFunc {
return
}
render.JSON(w, http.StatusOK, usr)
render.JSON(w, http.StatusCreated, usr)
}
}

View File

@ -38,6 +38,6 @@ func HandleCreate(webhookCtrl *webhook.Controller) http.HandlerFunc {
return
}
render.JSON(w, http.StatusOK, hook)
render.JSON(w, http.StatusCreated, hook)
}
}

View File

@ -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)
}

View File

@ -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)

View File

@ -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)