From 76709c1ebbdaa7d6ae22144bfb779714845f3fb7 Mon Sep 17 00:00:00 2001 From: ThatcherK Date: Fri, 10 Nov 2023 13:04:08 +0300 Subject: [PATCH] Change api url variable name --- src/utils/constants.js | 2 +- src/utils/data.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/constants.js b/src/utils/constants.js index ecb8f2b5..708cd8a6 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -1,3 +1,3 @@ // eslint-disable-next-line import/prefer-default-export export const NO_DATA = 0; -export const DATA_API_URL = 'https://api.datahub.go.ug/document/data/'; +export const BASE_DATA_API_URL = 'https://api.datahub.go.ug/document/data/'; diff --git a/src/utils/data.js b/src/utils/data.js index e38845ff..d2eb81b4 100644 --- a/src/utils/data.js +++ b/src/utils/data.js @@ -1,6 +1,6 @@ import axios from 'axios'; import { parse } from 'papaparse'; -import { DATA_API_URL } from './constants'; +import { BASE_DATA_API_URL } from './constants'; const fetchCSVData = (url) => new Promise((resolve) => { @@ -49,7 +49,7 @@ const fetchData = (url) => { export const fetchDataFromAPI = (dataID) => axios - .get(`${DATA_API_URL}${dataID}`) + .get(`${BASE_DATA_API_URL}${dataID}`) .then((response) => response.data.results) .catch((error) => error);