diff --git a/components/WebsiteDetails.js b/components/WebsiteDetails.js index 520c339f..e3a7e2c2 100644 --- a/components/WebsiteDetails.js +++ b/components/WebsiteDetails.js @@ -30,16 +30,19 @@ const views = { event: EventsTable, }; -export default function WebsiteDetails({ websiteId, shareId }) { +export default function WebsiteDetails({ websiteId, token }) { const router = useRouter(); - const { data } = useFetch(`/api/website/${websiteId}`, { share_id: shareId }); + const { data } = useFetch(`/api/website/${websiteId}`, { token }); const [chartLoaded, setChartLoaded] = useState(false); const [countryData, setCountryData] = useState(); const [eventsData, setEventsData] = useState(); const { query: { id, view }, + basePath, + asPath, } = router; - const path = `/website/${id.join('/')}`; + + const path = `${basePath}/${asPath.split('/')[1]}/${id.join('/')}`; const BackButton = () => (