@@ -52,7 +52,7 @@ func GetReleaseAttachment(ctx *context.APIContext) {
5252 // "$ref": "#/responses/Attachment"
5353
5454 releaseID := ctx .ParamsInt64 (":id" )
55- attachID := ctx .ParamsInt64 (":asset " )
55+ attachID := ctx .ParamsInt64 (":attachment_id " )
5656 attach , err := repo_model .GetAttachmentByID (ctx , attachID )
5757 if err != nil {
5858 if repo_model .IsErrAttachmentNotExist (err ) {
@@ -68,7 +68,7 @@ func GetReleaseAttachment(ctx *context.APIContext) {
6868 return
6969 }
7070 // FIXME Should prove the existence of the given repo, but results in unnecessary database requests
71- ctx .JSON (http .StatusOK , convert .ToAttachment ( attach ))
71+ ctx .JSON (http .StatusOK , convert .ToAPIAttachment ( ctx . Repo . Repository , attach ))
7272}
7373
7474// ListReleaseAttachments lists all attachments of the release
@@ -117,7 +117,7 @@ func ListReleaseAttachments(ctx *context.APIContext) {
117117 ctx .Error (http .StatusInternalServerError , "LoadAttributes" , err )
118118 return
119119 }
120- ctx .JSON (http .StatusOK , convert .ToRelease (ctx , release ).Attachments )
120+ ctx .JSON (http .StatusOK , convert .ToAPIRelease (ctx , ctx . Repo . Repository , release ).Attachments )
121121}
122122
123123// CreateReleaseAttachment creates an attachment and saves the given file
@@ -209,7 +209,7 @@ func CreateReleaseAttachment(ctx *context.APIContext) {
209209 return
210210 }
211211
212- ctx .JSON (http .StatusCreated , convert .ToAttachment ( attach ))
212+ ctx .JSON (http .StatusCreated , convert .ToAPIAttachment ( ctx . Repo . Repository , attach ))
213213}
214214
215215// EditReleaseAttachment updates the given attachment
@@ -256,7 +256,7 @@ func EditReleaseAttachment(ctx *context.APIContext) {
256256
257257 // Check if release exists an load release
258258 releaseID := ctx .ParamsInt64 (":id" )
259- attachID := ctx .ParamsInt64 (":asset " )
259+ attachID := ctx .ParamsInt64 (":attachment_id " )
260260 attach , err := repo_model .GetAttachmentByID (ctx , attachID )
261261 if err != nil {
262262 if repo_model .IsErrAttachmentNotExist (err ) {
@@ -279,7 +279,7 @@ func EditReleaseAttachment(ctx *context.APIContext) {
279279 if err := repo_model .UpdateAttachment (ctx , attach ); err != nil {
280280 ctx .Error (http .StatusInternalServerError , "UpdateAttachment" , attach )
281281 }
282- ctx .JSON (http .StatusCreated , convert .ToAttachment ( attach ))
282+ ctx .JSON (http .StatusCreated , convert .ToAPIAttachment ( ctx . Repo . Repository , attach ))
283283}
284284
285285// DeleteReleaseAttachment delete a given attachment
@@ -318,7 +318,7 @@ func DeleteReleaseAttachment(ctx *context.APIContext) {
318318
319319 // Check if release exists an load release
320320 releaseID := ctx .ParamsInt64 (":id" )
321- attachID := ctx .ParamsInt64 (":asset " )
321+ attachID := ctx .ParamsInt64 (":attachment_id " )
322322 attach , err := repo_model .GetAttachmentByID (ctx , attachID )
323323 if err != nil {
324324 if repo_model .IsErrAttachmentNotExist (err ) {
0 commit comments