Skip to content

Commit 6dc21f6

Browse files
authored
Merge pull request #98 from UTSC-CSCC01-Software-Engineering-I/hotfix/replace-api-urls
replaced all references to localhost with EC2 url
2 parents 4756377 + 380679b commit 6dc21f6

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

BackEnd/server/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,7 +2114,7 @@ app.post('/api/exec/clubs/:clubID/updatePosting', userExecCheck, uploadPublicPos
21142114

21152115
let imageUrl = null;
21162116
if (req.positionImageName) {
2117-
imageUrl = `http://localhost:3000/uploads/public/${req.positionImageName}`;
2117+
imageUrl = `http://3.142.69.13:3000/uploads/public/${req.positionImageName}`;
21182118
}
21192119

21202120
const querySearchExists = "SELECT * FROM positions WHERE positionID = $1";
@@ -2138,7 +2138,7 @@ app.post('/api/exec/clubs/:clubID/updatePosting', userExecCheck, uploadPublicPos
21382138
}else if (result.rows[0]['positionimage'] && imageUrl) {
21392139
// Delete old image if exists and there is new image
21402140
const prevImageUrl = result.rows[0]['positionimage'];
2141-
const prevImagePath = prevImageUrl.replace(/^http:\/\/localhost:3000\//, '');
2141+
const prevImagePath = prevImageUrl.replace(/^http:\/\/3.142.69.13:3000\//, '');
21422142
const imagePath = path.join(__dirname, prevImagePath);
21432143
if (fs.existsSync(imagePath)) {
21442144
try {
@@ -2197,7 +2197,7 @@ app.post('/api/exec/clubs/:clubID/postPosition', userExecCheck, uploadPublicPosi
21972197
// Construct image URL if file was uploaded
21982198
let imageUrl = null;
21992199
if (req.positionImageName) {
2200-
imageUrl = `http://localhost:3000/uploads/public/${req.positionImageName}`;
2200+
imageUrl = `http://3.142.69.13:3000/uploads/public/${req.positionImageName}`;
22012201
}
22022202

22032203
const queryUploadPosition = "INSERT INTO positions (positionName, positionDesc, posOpenings, posFilled, clubID, positionImage) VALUES ($1, $2, $3, $4, $5, $6) RETURNING *";

FrontEnd/src/pages/ModeratorVerificationList.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ const ModeratorVerificationList = () => {
228228
form.proofofclub.startsWith('/uploads/') ? (
229229
// File upload link
230230
<a
231-
href={`http://localhost:3000${form.proofofclub}`}
231+
href={`http://3.142.69.13:3000${form.proofofclub}`}
232232
target="_blank" rel="noopener noreferrer"
233233
className="text-blue-600 hover:underline break-all"
234234
>

FrontEnd/src/pages/MyApplications.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ const MyApplications = () => {
135135
<div>
136136
<h4 className="font-semibold text-gray-700">Application File:</h4>
137137
<a
138-
href={`http://localhost:3000/club_files/${app.clubid}/${app.positionid}/${app.appfile}`}
138+
href={`http://3.142.69.13:3000/club_files/${app.clubid}/${app.positionid}/${app.appfile}`}
139139
target="_blank"
140140
rel="noopener noreferrer"
141141
className="text-blue-600 hover:underline"

FrontEnd/src/pages/ProfilePage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function ProfilePage() {
103103
{user.followedClubs.map((club) => (
104104
<li key={club.clubid} className="flex items-center mb-2">
105105
<img
106-
src={club.clubimage ? `http://localhost:3000${club.clubimage}` : '/default-club.png'}
106+
src={club.clubimage ? `http://3.142.69.13:3000${club.clubimage}` : '/default-club.png'}
107107
alt={club.clubname}
108108
className="w-12 h-12 rounded-full mr-4"
109109
/>

FrontEnd/src/pages/VerificationForm.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ const VerificationForm = () => {
223223
<strong>Submitted Proof:</strong>
224224
{verificationData.proofofclub.startsWith('/uploads/') ?
225225
<a
226-
href={`http://localhost:3000${verificationData.proofofclub}`}
226+
href={`http://3.142.69.13:3000${verificationData.proofofclub}`}
227227
target="_blank" rel="noopener noreferrer"
228228
className="text-blue-500 hover:underline ml-1"
229229
>

0 commit comments

Comments
 (0)