Răsfoiți Sursa

return 201 when successfully created a resource

Mohammed Nafees 4 ani în urmă
părinte
comite
f0457a3ad3

+ 1 - 0
api/server/handlers/registry/create.go

@@ -232,5 +232,6 @@ func (p *RegistryCreateHandler) ServeHTTP(w http.ResponseWriter, r *http.Request
 		},
 	))
 
+	w.WriteHeader(http.StatusCreated)
 	p.WriteResult(w, r, regModel.ToRegistryType())
 }

+ 2 - 0
api/server/handlers/registry/create_repository.go

@@ -51,4 +51,6 @@ func (p *RegistryCreateRepositoryHandler) ServeHTTP(w http.ResponseWriter, r *ht
 		p.HandleAPIError(w, r, apierrors.NewErrInternal(err))
 		return
 	}
+
+	w.WriteHeader(http.StatusCreated)
 }

+ 2 - 0
api/server/handlers/release/create.go

@@ -214,6 +214,8 @@ func (c *CreateReleaseHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
 			FlowID: operationID,
 		},
 	))
+
+	w.WriteHeader(http.StatusCreated)
 }
 
 func createReleaseFromHelmRelease(

+ 1 - 1
api/server/router/v1/release.go

@@ -171,7 +171,7 @@ func getV1ReleaseRoutes(
 	//   - name: name
 	//   - name: version
 	// responses:
-	//   '201':
+	//   '200':
 	//     description: Successfully got the release
 	//     schema:
 	//       $ref: '#/definitions/GetReleaseResponse'