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

Commit 2f1e11e

Browse files
author
Noah Hanjun Lee
authored
Fix the method of creating the remote deployment (#246)
1 parent 63800a4 commit 2f1e11e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

internal/server/router.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func NewRouter(c *RouterConfig) *gin.Engine {
144144
repov1.GET("/:namespace/:name/deployments", rm.RepoReadPerm(), r.ListDeployments)
145145
repov1.POST("/:namespace/:name/deployments", rm.RepoWritePerm(), r.CreateDeployment)
146146
repov1.GET("/:namespace/:name/deployments/:number", rm.RepoReadPerm(), r.GetDeploymentByNumber)
147-
repov1.PATCH("/:namespace/:name/deployments/:number", rm.RepoWritePerm(), r.UpdateDeployment)
147+
repov1.PUT("/:namespace/:name/deployments/:number", rm.RepoWritePerm(), r.UpdateDeployment)
148148
repov1.GET("/:namespace/:name/deployments/:number/changes", rm.RepoReadPerm(), r.ListDeploymentChanges)
149149
repov1.POST("/:namespace/:name/deployments/:number/rollback", rm.RepoWritePerm(), r.RollbackDeployment)
150150
repov1.GET("/:namespace/:name/deployments/:number/reviews", rm.RepoReadPerm(), r.ListReviews)

openapi/v1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ paths:
588588
description: The deployment payload or the configuration is invalid.
589589
'500':
590590
$ref: '#/components/responses/500InternalError'
591-
patch:
591+
put:
592592
tags:
593593
- Repo
594594
summary: Create a remote deployment when the status of the deployment is 'waiting'.

ui/src/apis/deployment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export const createRemoteDeployment = async (namespace: string, name: string, nu
220220
const response = await _fetch(`${instance}/api/v1/repos/${namespace}/${name}/deployments/${number}`, {
221221
headers,
222222
credentials: 'same-origin',
223-
method: "PATCH",
223+
method: "PUT",
224224
})
225225
if (response.status === StatusCodes.FORBIDDEN) {
226226
const message = await response.json().then(data => data.message)

0 commit comments

Comments
 (0)