add download, fix empty apicontext, add url to describe

This commit is contained in:
2023-03-17 13:04:52 +01:00
parent 11802a56e9
commit f5e0284c40
10 changed files with 145 additions and 6 deletions

View File

@@ -25,6 +25,7 @@ import (
"os"
"path/filepath"
"strings"
"time"
)
@@ -260,6 +261,10 @@ func Describe(c *fiber.Ctx, cfg *cfg.Config, db *Db) error {
"No upload with that id could be found!")
}
for _, upload := range uploads.Entries {
upload.Url = strings.Join([]string{cfg.Url, "download", id, upload.File}, "/")
}
// if we reached this point we can signal success
uploads.Success = true
uploads.Code = fiber.StatusOK