diff --git a/public/es/nvrf/data/Federal_Voter_Registration_es.pdf b/public/data/es/nvrf/Federal_Voter_Registration_es.pdf similarity index 100% rename from public/es/nvrf/data/Federal_Voter_Registration_es.pdf rename to public/data/es/nvrf/Federal_Voter_Registration_es.pdf diff --git a/public/es/nvrf/data/navigation.json b/public/data/es/nvrf/navigation.json similarity index 100% rename from public/es/nvrf/data/navigation.json rename to public/data/es/nvrf/navigation.json diff --git a/public/es/nvrf/data/strings.json b/public/data/es/nvrf/strings.json similarity index 100% rename from public/es/nvrf/data/strings.json rename to public/data/es/nvrf/strings.json diff --git a/public/nvrf/data/Federal_Voter_Registration_en.pdf b/public/data/nvrf/Federal_Voter_Registration_en.pdf similarity index 100% rename from public/nvrf/data/Federal_Voter_Registration_en.pdf rename to public/data/nvrf/Federal_Voter_Registration_en.pdf diff --git a/public/nvrf/data/navigation.json b/public/data/nvrf/navigation.json similarity index 100% rename from public/nvrf/data/navigation.json rename to public/data/nvrf/navigation.json diff --git a/public/nvrf/data/strings.json b/public/data/nvrf/strings.json similarity index 100% rename from public/nvrf/data/strings.json rename to public/data/nvrf/strings.json diff --git a/src/Utils/JsonHelper.jsx b/src/Utils/JsonHelper.jsx index 1321953a..f6268aab 100644 --- a/src/Utils/JsonHelper.jsx +++ b/src/Utils/JsonHelper.jsx @@ -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)); diff --git a/src/Utils/pdfLoader.jsx b/src/Utils/pdfLoader.jsx index 9515e36c..ae8d7631 100644 --- a/src/Utils/pdfLoader.jsx +++ b/src/Utils/pdfLoader.jsx @@ -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()