Skip to content

Commit

Permalink
fix: fix invalid image URL generation (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 authored Nov 12, 2024
1 parent 26e7872 commit 2db3b3f
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/components/InfoModal.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import PreviewOutlinedIcon from '@mui/icons-material/PreviewOutlined';
import Accordion from '@mui/material/Accordion';
import AccordionDetails from '@mui/material/AccordionDetails';
import AccordionSummary from '@mui/material/AccordionSummary';
import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
import Typography from '@mui/material/Typography';
import Modal from '@mui/material/Modal';
import { useState } from 'react';
import axios from 'axios';
import PreviewOutlinedIcon from '@mui/icons-material/PreviewOutlined';
import Typography from '@mui/material/Typography';
import Grid from '@mui/material/Unstable_Grid2';
import Accordion from '@mui/material/Accordion';
import AccordionSummary from '@mui/material/AccordionSummary';
import AccordionDetails from '@mui/material/AccordionDetails';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import axios from 'axios';
import { useState } from 'react';
import DeleteButton from './DeleteButton';

const style = {
Expand All @@ -32,6 +32,10 @@ export default function ModalInfo({barcode}: ModalInfoProps) {

const [open, setOpen] = useState(false);
const buildUrl = (barcode: string, imageId: string, def: string, rev?: string) => {
// fill the barcode with 0 if it's not 13 characters long
if (barcode.length < 13) {
barcode = barcode.padStart(13, '0');
}
// split the barcode into 4 parts
const part1 = barcode.slice(0, 3);
const part2 = barcode.slice(3, 6);
Expand Down

0 comments on commit 2db3b3f

Please sign in to comment.