Skip to content

Commit

Permalink
fix heDataCall
Browse files Browse the repository at this point in the history
  • Loading branch information
folland87 committed Mar 22, 2024
1 parent 217f742 commit 7fde8c1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions client/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ VITE_APP_NAME="scanR"
VITE_HEADER_TAG="dev"
VITE_HEADER_TAG_COLOR="blue-ecume"
VITE_VERSION=$npm_package_version
VITE_APP_MATOMO_BASE_URL="https://matomo.staging.dataesr.ovh"
VITE_APP_MATOMO_SITE_ID="4"
2 changes: 1 addition & 1 deletion client/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { VITE_APP_MATOMO_BASE_URL, VITE_APP_MATOMO_SITE_ID } = import.meta.env;
const matomo = createInstance({
urlBase: VITE_APP_MATOMO_BASE_URL,
siteId: VITE_APP_MATOMO_SITE_ID,
disabled: !VITE_APP_MATOMO_BASE_URL || !VITE_APP_MATOMO_SITE_ID,
disabled: import.meta.env.DEV,
configurations: {
disableCookies: true,
},
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/search/he.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function HEPartners() {
? data.length >= MAX_RESULTS_BEFORE_USER_CLICK
: false;

const [keywords, setKeywords] = useState<string[]>(() => currentQuery.split('|'))
const [keywords, setKeywords] = useState<string[]>(currentQuery?.split('|'))


if (isError || dataError) return <Error500 error={error} />
Expand Down
6 changes: 2 additions & 4 deletions client/src/pages/search/hooks/useHeData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useQuery } from "@tanstack/react-query";
import { useEffect, useMemo } from "react";
import { useParams, useSearchParams } from "react-router-dom";
import { getTopics } from "../../../api/topics";

type TopicData = {
TopicDetails: TopicsDetails,
Expand All @@ -27,10 +28,7 @@ export default function useHeData() {

const { data, isFetching, isError, error } = useQuery<TopicData>({
queryKey: ["he-call-data", id],
queryFn: async () => {
const res = await fetch(`https://scanr.dataesr.ovh/topics/${id}`);
return res.json();
},
queryFn: () => getTopics(id),
enabled: !!id,
});

Expand Down

0 comments on commit 7fde8c1

Please sign in to comment.