changed status code to 201 when creating resource
This commit is contained in:
		@@ -149,6 +149,8 @@ func (c *AdmiraltyController) CreateSource() {
 | 
			
		||||
	// TODO : Return a description of the created resource
 | 
			
		||||
	var respData map[string]interface{}
 | 
			
		||||
	err = json.Unmarshal(res,&respData)
 | 
			
		||||
	
 | 
			
		||||
	c.Ctx.Output.SetStatus(201)
 | 
			
		||||
	c.Data["json"] = respData
 | 
			
		||||
	c.ServeJSON()
 | 
			
		||||
	
 | 
			
		||||
@@ -200,6 +202,7 @@ func (c *AdmiraltyController) CreateAdmiraltyTarget(){
 | 
			
		||||
		c.Data["json"] = map[string]string{"error": err.Error()}
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	c.Ctx.Output.SetStatus(201)
 | 
			
		||||
	c.Data["json"] = data
 | 
			
		||||
	c.ServeJSON()
 | 
			
		||||
 | 
			
		||||
@@ -258,7 +261,7 @@ func(c *AdmiraltyController) GetKubeSecret() {
 | 
			
		||||
 | 
			
		||||
// @Param execution path 	string 		true	"execution id of the workflow"
 | 
			
		||||
// @Param kubeconfig 	body	controllers.Kubeconfig 		true 	"Kubeconfig to use when creating secret"
 | 
			
		||||
// @Success 200 
 | 
			
		||||
// @Success 201 
 | 
			
		||||
// @router /secret/:execution [post]
 | 
			
		||||
func (c *AdmiraltyController) CreateKubeSecret() {
 | 
			
		||||
	var kubeconfig 	RemoteKubeconfig
 | 
			
		||||
@@ -299,6 +302,7 @@ func (c *AdmiraltyController) CreateKubeSecret() {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	err = json.Unmarshal(resp,&respData)
 | 
			
		||||
	c.Ctx.Output.SetStatus(201)
 | 
			
		||||
	c.Data["json"] = respData
 | 
			
		||||
	c.ServeJSON()
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user