Skip to content

Database diagrams editor that allows you to visualize and design your DB with a single query.

fix(templates): tag urls lowercase to support browsers (#397)

Guy Ben-Aharon959e5402b8c1
diff --git a/src/pages/templates-page/templates-page.tsx b/src/pages/templates-page/templates-page.tsx
index 656b176e..90fc347a 100644
--- a/src/pages/templates-page/templates-page.tsx
+++ b/src/pages/templates-page/templates-page.tsx
@@ -142,8 +142,10 @@ const TemplatesPageComponent: React.FC = () => {
className="mt-1 shrink-0"
items={allTags.map((currentTag) => ({
title: currentTag,
- href: `/templates/tags/${currentTag}`,
- selected: tag === currentTag,
+ href: `/templates/tags/${currentTag.toLowerCase()}`,
+ selected:
+ tag?.toLowerCase() ===
+ currentTag.toLocaleLowerCase(),
}))}
/>
) : null}
diff --git a/src/templates-data/template-utils.ts b/src/templates-data/template-utils.ts
index 9cfcd3ff..e3e4e76c 100644
--- a/src/templates-data/template-utils.ts
+++ b/src/templates-data/template-utils.ts
@@ -33,7 +33,9 @@ export const getTemplatesAndAllTags = async ({
if (tag) {
return {
- templates: templates.filter((t) => t.tags.includes(tag)),
+ templates: templates.filter((t) =>
+ t.tags.some((t) => t.toLowerCase() === tag.toLowerCase())
+ ),
tags: allTags,
};
}