From 6f07de32308ade153bd4b7f97a6f56c2b5b6fba5 Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Mon, 11 Sep 2023 03:31:27 +0200 Subject: [PATCH] =?UTF-8?q?Add=20the=20original=20filename=20to=20media?= =?UTF-8?q?=E2=80=99s=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It server no other purpose than to “look better” for humans. --- pkg/app/public.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/app/public.go b/pkg/app/public.go index a67abd5..46c3978 100644 --- a/pkg/app/public.go +++ b/pkg/app/public.go @@ -65,7 +65,7 @@ type campsiteType struct { } 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 { panic(err) }