Skip to content

Commit

Permalink
Update how the analysis data is fetched
Browse files Browse the repository at this point in the history
  • Loading branch information
clementprdhomme committed Oct 8, 2024
1 parent 4d2b660 commit d5ce305
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
3 changes: 1 addition & 2 deletions frontend/.env.default
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ HUBSPOT_TOKEN=

LOCALAZY_CDN=

NEXT_PUBLIC_ANALYSIS_CF_MARINE_URL=
NEXT_PUBLIC_ANALYSIS_CF_TERRESTRIAL_URL=
NEXT_PUBLIC_ANALYSIS_CF_URL=
NEXT_PUBLIC_FEATURE_FLAG_ANALYSIS=

HTTP_AUTH_USERNAME=
Expand Down
10 changes: 4 additions & 6 deletions frontend/src/containers/map/content/map/modelling/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ import { useSyncMapContentSettings } from '@/containers/map/sync-settings';
import { ModellingData } from '@/types/modelling';

const fetchModelling = async (tab: string, feature: Feature) => {
const url =
tab === 'marine'
? process.env.NEXT_PUBLIC_ANALYSIS_CF_MARINE_URL
: process.env.NEXT_PUBLIC_ANALYSIS_CF_TERRESTRIAL_URL;

return axios.post<ModellingData>(url, feature);
return axios.post<ModellingData>(process.env.NEXT_PUBLIC_ANALYSIS_CF_URL, {
environment: tab,
feature,
});
};

const Modelling = () => {
Expand Down
3 changes: 1 addition & 2 deletions infrastructure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ Deployment to the CloudRun instances is accomplished by building Docker images a
- the following secrets set by terraform in STAGING_CLIENT_ENV_TF_MANAGED (in the format of an .env file):
- NEXT_PUBLIC_URL
- NEXT_PUBLIC_API_URL
- NEXT_PUBLIC_ANALYSIS_CF_MARINE_URL
- NEXT_PUBLIC_ANALYSIS_CF_TERRESTRIAL_URL
- NEXT_PUBLIC_ANALYSIS_CF_URL
- NEXT_PUBLIC_ENVIRONMENT
- LOG_LEVEL
- additional secrets set manually in STAGING_CLIENT_ENV (copy to be managed in LastPass)
Expand Down

0 comments on commit d5ce305

Please sign in to comment.