Skip to content

Commit

Permalink
fix all localhosts hopefully
Browse files Browse the repository at this point in the history
  • Loading branch information
Pulkith committed Jul 16, 2024
1 parent 4c047d5 commit 957d6ec
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 20 deletions.
4 changes: 2 additions & 2 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link rel="icon" href="%PUBLIC_URL%/hack4impact.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Boilerplate for Hack4Impact" />
<meta name="description" content="West Park by Hack4Impact" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/hack4impact.ico" />
<!--
manifest.json provides metadata used when your web app is installed on a
Expand All @@ -27,7 +27,7 @@
-->
<script src="https://kit.fontawesome.com/c87e40864d.js" crossorigin="anonymous"></script>

<title>Boilerplate</title>
<title>West Park Cultural</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
2 changes: 1 addition & 1 deletion client/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"short_name": "Boilerplate",
"short_name": "West Park",
"name": "Hack4Impact",
"icons": [
{
Expand Down
4 changes: 0 additions & 4 deletions client/src/Communications/CommunicationsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ import IDonation from '../util/types/donation';
import { useData, getData } from '../util/api';
import PopupPage from '../Popup/PopupPage';

const BACKENDURL = process.env.PUBLIC_URL
? process.env.PUBLIC_URL
: 'http://localhost:4000';

const modalStyle = {
position: 'absolute',
top: '50%',
Expand Down
8 changes: 2 additions & 6 deletions client/src/DonationInfo/DonationInfoPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ function DonationInfoPage() {
setDonationData(donation.data);
if (donation.data.donor_id) {
try {
const res = await axios.get(
`http://localhost:4000/api/donor/id/${donation.data.donor_id}`,
);
const res = await getData(`donor/id/${donation.data.donor_id}`);
setDonorName(res.data.contact_name);
setDonator(res.data);
} catch (error) {
Expand All @@ -155,9 +153,7 @@ function DonationInfoPage() {

if (donation.data.purpose_id) {
try {
const res = await axios.get(
`http://localhost:4000/api/purpose/${donation.data.purpose_id}`,
);
const res = await getData(`purpose/${donation.data.purpose_id}`);
setPurpose(res.data.name);
setCampaignPurpose(res.data);
} catch (error) {
Expand Down
10 changes: 3 additions & 7 deletions client/src/Popup/PopupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '@mui/material';
import axios from 'axios';
import IDonor from '../util/types/donor';
import { useData } from '../util/api';
import { getData, useData } from '../util/api';

interface BasicDonationStat {
amount: number;
Expand Down Expand Up @@ -58,9 +58,7 @@ function PopupPage({ open, onClose, donorID }: PopupPageProps) {
const fetchDonor = async () => {
setLoading(true);
try {
const res = await axios.get(
`http://localhost:4000/api/donor/id/${donorID}`,
);
const res = await getData(`donor/id/${donorID}`);
setDonorData(res.data);
} catch (error) {
console.error('Failed to fetch donor:', error);
Expand All @@ -77,9 +75,7 @@ function PopupPage({ open, onClose, donorID }: PopupPageProps) {
useEffect(() => {
const fetchDonations = async () => {
try {
const res = await axios.get(
`http://localhost:4000/api/donation/donor/${donorID}`,
);
const res = await getData(`donation/donor/${donorID}`);
setDonationsData(res.data);
} catch (error) {
console.error('Failed to fetch donation:', error);
Expand Down

0 comments on commit 957d6ec

Please sign in to comment.