29 Mei 2026
This commit is contained in:
@@ -22,7 +22,7 @@ export default function AddBookingPage() {
|
||||
const fetchRooms = async () => {
|
||||
try {
|
||||
const token = localStorage.getItem("token");
|
||||
const res = await axios.get("http://localhost:8080/api/rooms", {
|
||||
const res = await axios.get("http://172.17.110.6:8080/api/rooms", {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
setRooms(res.data.data);
|
||||
@@ -46,7 +46,7 @@ export default function AddBookingPage() {
|
||||
const startISO = new Date(startTime).toISOString();
|
||||
const endISO = new Date(endTime).toISOString();
|
||||
|
||||
await axios.post("http://localhost:8080/api/bookings", {
|
||||
await axios.post("http://172.17.110.6:8080/api/bookings", {
|
||||
room_id: parseInt(selectedRoomId),
|
||||
start_time: startISO,
|
||||
end_time: endISO,
|
||||
|
||||
@@ -58,9 +58,9 @@ export default function CalendarViewPage() {
|
||||
const token = localStorage.getItem("token");
|
||||
// 2. FETCH DATA SCHEDULES BERSAMAAN DENGAN ROOMS & BOOKINGS
|
||||
const [roomsRes, bookingsRes, schedulesRes] = await Promise.all([
|
||||
axios.get("http://localhost:8080/api/rooms", { headers: { Authorization: `Bearer ${token}` } }),
|
||||
axios.get("http://localhost:8080/api/bookings", { headers: { Authorization: `Bearer ${token}` } }),
|
||||
axios.get("http://localhost:8080/api/schedules", { headers: { Authorization: `Bearer ${token}` } })
|
||||
axios.get("http://172.17.110.6:8080/api/rooms", { headers: { Authorization: `Bearer ${token}` } }),
|
||||
axios.get("http://172.17.110.6:8080/api/bookings", { headers: { Authorization: `Bearer ${token}` } }),
|
||||
axios.get("http://172.17.110.6:8080/api/schedules", { headers: { Authorization: `Bearer ${token}` } })
|
||||
]);
|
||||
|
||||
setRooms(roomsRes.data.data || []);
|
||||
|
||||
@@ -45,7 +45,7 @@ export default function Dashboard() {
|
||||
|
||||
const fetchRooms = async (token: string) => {
|
||||
try {
|
||||
const response = await axios.get("http://localhost:8080/api/rooms", {
|
||||
const response = await axios.get("http://172.17.110.6:8080/api/rooms", {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
setRooms(response.data.data);
|
||||
@@ -79,7 +79,7 @@ export default function Dashboard() {
|
||||
const endISO = new Date(endTime).toISOString();
|
||||
|
||||
await axios.post(
|
||||
"http://localhost:8080/api/bookings",
|
||||
"http://172.17.110.6:8080/api/bookings",
|
||||
{
|
||||
room_id: selectedRoom?.room_id,
|
||||
start_time: startISO,
|
||||
|
||||
Reference in New Issue
Block a user