Skip to content

Commit

Permalink
fix: .env url in code
Browse files Browse the repository at this point in the history
  • Loading branch information
Valimp committed Feb 5, 2024
1 parent 9a976a4 commit e2f657f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion interface/.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ VITE_DEVELOPPEMENT_MODE = "development"

# ApiUrl
# ------
VITE_API_URL = "http://localhost:8000"
VITE_API_URL = "http://localhost:8000"

# PO Url
# ------
VITE_PO_URL = "https://world.openfoodfacts.org"
2 changes: 1 addition & 1 deletion interface/components/BarcodeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Button from '@mui/material/Button';
import { Link } from 'react-router-dom';

export default function BarcodeButton(props: { barcode: string }) {
const linkUrl = `https://world.openfoodfacts.org/cgi/product.pl?type=edit&code=${props.barcode}`;
const linkUrl = `${import.meta.env.VITE_PO_URL}/cgi/product.pl?type=edit&code=${props.barcode}`;

return (
<Button
Expand Down
4 changes: 2 additions & 2 deletions interface/components/Ticket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default function Ticket({ticket}: any) {

<div style={{ display: 'flex', gap: '10px', alignItems: 'center'}}>
<img
//src={ticket.url}
src='https://images.openfoodfacts.net/images/products/327/408/000/5003/1.400.jpg'
src={ticket.url}
// src='https://images.openfoodfacts.net/images/products/327/408/000/5003/1.400.jpg'
alt={ticket.barcode}
width={100}
height={100}
Expand Down

0 comments on commit e2f657f

Please sign in to comment.