Skip to content

Commit e90d87d

Browse files
Apps/nutritionfacts/lowercase (#156)
* lowercase the IDs * additional lowercase matching * Update apps/nutritionfacts/src/App.tsx Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 20c6a67 commit e90d87d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/nutritionfacts/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { getLayoutFromParams, NutritionFactsForm } from "./Components/Layout";
1515

1616
const App: FC = () => {
1717
const searchParams = new URLSearchParams(window.location.search);
18-
const id = searchParams.get("id");
18+
const id = searchParams.get("id")?.toLowerCase();
1919

2020
const [product, setProduct] = useState<AiInfoFeatureProps | undefined>(
2121
undefined,
@@ -37,8 +37,8 @@ const App: FC = () => {
3737
}, [product?.uid, product?.name]);
3838

3939
useEffect(() => {
40-
if (id && id in AiInfo) {
41-
setProduct(AiInfo[id as keyof typeof AiInfo]);
40+
if (id && id.toLowerCase() in AiInfo) {
41+
setProduct(AiInfo[id.toLowerCase() as keyof typeof AiInfo]);
4242
}
4343
}, [id]);
4444

0 commit comments

Comments
 (0)