Skip to content

Commit 8e7472a

Browse files
committed
Fixed: baseURL
1 parent d16ea90 commit 8e7472a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

frontend/src/components/Navigation.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import React, { useState, useEffect, useRef } from "react";
44
import { Link, useNavigate } from "react-router-dom";
55

66
import { getTokenWithExpiration } from "../pages/Auth/Session";
7+
import appConfig from "../config/appConfig";
78

89
export default function Navigation() {
910
const [user, setUser] = useState({});
10-
const baseURL = "http://127.0.0.1:8000/api";
1111

1212
const navigate = useNavigate();
1313
const token = getTokenWithExpiration("token");
@@ -46,14 +46,14 @@ export default function Navigation() {
4646

4747
const fetchData = async () => {
4848
axios.defaults.headers.common["Authorization"] = `Bearer ${token}`;
49-
await axios.get(`${baseURL}/user`).then((response) => {
49+
await axios.get(`${appConfig.baseURL}/user`).then((response) => {
5050
setUser(response.data);
5151
});
5252
};
5353

5454
const logoutHandler = async () => {
5555
axios.defaults.headers.common["Authorization"] = `Bearer ${token}`;
56-
await axios.post(`${baseURL}/logout`).then(() => {
56+
await axios.post(`${appConfig.baseURL}/logout`).then(() => {
5757
localStorage.removeItem("token");
5858
navigate("/");
5959
});

frontend/src/config/appConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const appConfig = {
22
debounceTimeout: 750,
33
expirationTime: 60 * 60 * 1000,
4-
baseURL: "http://127.0.0.1:8000/",
4+
baseURL: "http://127.0.0.1:8000",
55
baseurlAPI: "http://127.0.0.1:8000/api",
66
};
77

frontend/src/pages/Gallery/Gallery.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ export default function Gallery() {
346346
<a
347347
href={
348348
appConfig.baseURL +
349-
"storage/images/" +
349+
"/storage/images/" +
350350
row.image
351351
}
352352
target="_BLANK"
@@ -355,7 +355,7 @@ export default function Gallery() {
355355
className="tw-aspect-square tw-w-4/6 tw-rounded-lg"
356356
src={
357357
appConfig.baseURL +
358-
"storage/images/" +
358+
"/storage/images/" +
359359
row.image
360360
}
361361
/>

0 commit comments

Comments
 (0)