Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Fix the method of creating the remote deployment #246

Merged
merged 1 commit into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/server/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func NewRouter(c *RouterConfig) *gin.Engine {
repov1.GET("/:namespace/:name/deployments", rm.RepoReadPerm(), r.ListDeployments)
repov1.POST("/:namespace/:name/deployments", rm.RepoWritePerm(), r.CreateDeployment)
repov1.GET("/:namespace/:name/deployments/:number", rm.RepoReadPerm(), r.GetDeploymentByNumber)
repov1.PATCH("/:namespace/:name/deployments/:number", rm.RepoWritePerm(), r.UpdateDeployment)
repov1.PUT("/:namespace/:name/deployments/:number", rm.RepoWritePerm(), r.UpdateDeployment)
repov1.GET("/:namespace/:name/deployments/:number/changes", rm.RepoReadPerm(), r.ListDeploymentChanges)
repov1.POST("/:namespace/:name/deployments/:number/rollback", rm.RepoWritePerm(), r.RollbackDeployment)
repov1.GET("/:namespace/:name/deployments/:number/reviews", rm.RepoReadPerm(), r.ListReviews)
Expand Down
2 changes: 1 addition & 1 deletion openapi/v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ paths:
description: The deployment payload or the configuration is invalid.
'500':
$ref: '#/components/responses/500InternalError'
patch:
put:
tags:
- Repo
summary: Create a remote deployment when the status of the deployment is 'waiting'.
Expand Down
2 changes: 1 addition & 1 deletion ui/src/apis/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export const createRemoteDeployment = async (namespace: string, name: string, nu
const response = await _fetch(`${instance}/api/v1/repos/${namespace}/${name}/deployments/${number}`, {
headers,
credentials: 'same-origin',
method: "PATCH",
method: "PUT",
})
if (response.status === StatusCodes.FORBIDDEN) {
const message = await response.json().then(data => data.message)
Expand Down