Add the original filename to media’s URL

It server no other purpose than to “look better” for humans.
This commit is contained in:
jordi fita mas 2023-09-11 03:31:27 +02:00
parent 151f7fc84e
commit 6f07de3230
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ type campsiteType struct {
} }
func mustCollectCampsiteTypes(ctx context.Context, company *auth.Company, conn *database.Conn, loc *locale.Locale) []*campsiteType { func mustCollectCampsiteTypes(ctx context.Context, company *auth.Company, conn *database.Conn, loc *locale.Locale) []*campsiteType {
rows, err := conn.Query(ctx, "select name, '/campsites/types/' || slug, '/media/' || encode(hash, 'hex') from campsite_type join media using (media_id) where campsite_type.company_id = $1", company.ID) rows, err := conn.Query(ctx, "select name, '/campsites/types/' || slug, '/media/' || encode(hash, 'hex') || '/' || original_filename from campsite_type join media using (media_id) where campsite_type.company_id = $1", company.ID)
if err != nil { if err != nil {
panic(err) panic(err)
} }