Skip to content

Commit

Permalink
Change api url variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatcherK committed Nov 10, 2023
1 parent b41d6f2 commit 76709c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utils/constants.js
Original file line number Diff line number Diff line change
@@ -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/';
4 changes: 2 additions & 2 deletions src/utils/data.js
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 76709c1

Please sign in to comment.