Rework userfile yet again

I'm settling on the idea that strings should never be returned from the
userfile system. Instead, indicate which collection you want and pass
objects across.
This commit is contained in:
Eli Ribble 2026-02-08 04:36:12 +00:00
parent c2d84b8734
commit fdd783c19c
No known key found for this signature in database
10 changed files with 198 additions and 160 deletions

View file

@ -62,7 +62,7 @@ func postPoolUpload(w http.ResponseWriter, r *http.Request, u *models.User) {
respondError(w, "Failed to parse form", err, http.StatusBadRequest)
return
}
uploads, err := userfile.SaveFileUpload(r, "csvfile", "pool", "csv")
uploads, err := userfile.SaveFileUpload(r, "csvfile", userfile.CollectionCSV)
if err != nil {
respondError(w, "Failed to extract image uploads", err, http.StatusInternalServerError)
return