Skip to content

Remove HOMEPAGE_STATS_API_URL from env vars #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion frontend/.env.expand
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ REACT_APP_IMAGE_UPLOAD_API_URL=$TM_IMAGE_UPLOAD_API_URL
REACT_APP_HOMEPAGE_VIDEO_URL=$TM_HOMEPAGE_VIDEO_URL
REACT_APP_HOMEPAGE_IMG_HIGH=$TM_HOMEPAGE_IMG_HIGH
REACT_APP_HOMEPAGE_IMG_LOW=$TM_HOMEPAGE_IMG_LOW
REACT_APP_HOMEPAGE_STATS_API_URL=$TM_HOMEPAGE_STATS_API_URL
REACT_APP_MAPBOX_TOKEN=$TM_MAPBOX_TOKEN
REACT_APP_ENABLE_SERVICEWORKER=$TM_ENABLE_SERVICEWORKER
REACT_APP_MAX_FILESIZE=$TM_IMPORT_MAX_FILESIZE
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/api/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query';

import { fetchExternalJSONAPI } from '../network/genericJSONRequest';
import api from './apiClient';
import { OHSOME_STATS_API_URL, defaultChangesetComment, HOMEPAGE_STATS_API_URL } from '../config';
import { OHSOME_STATS_API_URL, defaultChangesetComment } from '../config';

const ohsomeProxyAPI = (url) => {
const token = localStorage.getItem('token');
Expand All @@ -11,7 +11,7 @@ const ohsomeProxyAPI = (url) => {

export const useSystemStatisticsQuery = () => {
const fetchSystemStats = ({ signal }) => {
return api().get(HOMEPAGE_STATS_API_URL, {
return api().get(`system/statistics/`, {
signal,
});
};
Expand Down
4 changes: 0 additions & 4 deletions frontend/src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ export const OHSOME_STATS_BASE_URL =
export const OHSOME_STATS_API_URL =
process.env.REACT_APP_OHSOME_STATS_API_URL || 'https://stats.now.ohsome.org/api';

// OHM HOMEPAGE STATS ENDPOINT
export const HOMEPAGE_STATS_API_URL =
process.env.REACT_APP_HOMEPAGE_STATS_API_URL || 'https://tm-api.staging.openhistoricalmap.org/api/v4/system/statistics/';

// APPLICATION SETTINGS
export const DEFAULT_LOCALE = process.env.REACT_APP_DEFAULT_LOCALE || 'en';
export const ENVIRONMENT = process.env.REACT_APP_ENVIRONMENT || '';
Expand Down