refactor: change download controller method to use a path argument and not a query

This commit is contained in:
Derrick Hammer 2023-05-10 15:09:18 -04:00
parent 90e4ce6408
commit b44b12f85e
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 3 deletions

View File

@ -38,11 +38,9 @@ func (f *FilesController) PostUpload() {
_ = ctx.JSON(&UploadResponse{Cid: cidString}) _ = ctx.JSON(&UploadResponse{Cid: cidString})
} }
func (f *FilesController) GetDownload() { func (f *FilesController) GetDownloadBy(cidString string) {
ctx := f.Ctx ctx := f.Ctx
cidString := ctx.URLParam("cid")
_, err := cid.Valid(cidString) _, err := cid.Valid(cidString)
if sendError(ctx, err, iris.StatusBadRequest) { if sendError(ctx, err, iris.StatusBadRequest) {
return return