Skip to content

Commit

Permalink
VOTE-2993 Update json data directory location (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
rayestrada authored Oct 16, 2024
1 parent 15b27c4 commit d2bed2c
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Utils/JsonHelper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const fetchData = async(filename, setContent, setError) => {
}

export const fetchStaticData = async(filename, setContent, setError) => {
const path = `${BASEURL}${locale}/nvrf/data/${filename}`;
const path = `${BASEURL}/data${locale}/nvrf/${filename}`;
const response = await fetch(path)
.then(response => response.json())
.catch(() => setError(true));
Expand Down
4 changes: 2 additions & 2 deletions src/Utils/pdfLoader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { PDFDocument } from 'pdf-lib';

const loadPdf = async () => {
const lang = document.documentElement.lang;
const locale = lang!== "en"? `/${lang}` : "";
const formUrl = `${BASEURL}${locale}/nvrf/data/Federal_Voter_Registration_${lang}.pdf`;
const locale = lang !== "en" ? `/${lang}` : '';
const formUrl = `${BASEURL}/data${locale}/nvrf/Federal_Voter_Registration_${lang}.pdf`;
const formPdfBytes = await fetch(formUrl).then(res => res.arrayBuffer())
const pdfDoc = await PDFDocument.load(formPdfBytes)
const form = pdfDoc.getForm()
Expand Down

0 comments on commit d2bed2c

Please sign in to comment.