Skip to content

Commit

Permalink
fix(display ganttchart): GanttChart now use remote backend
Browse files Browse the repository at this point in the history
  • Loading branch information
NguyenDonLam committed Oct 10, 2024
1 parent 6aef8a2 commit 515d7bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/src/components/GanttChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
rawDate,
toRawDate,
} from "../scripts/solutionParsing";
import { LOCAL_API_URL, TimetableSolution, Unit } from "../scripts/api";
import { REMOTE_API_URL, TimetableSolution, Unit } from "../scripts/api";
import { useParams } from "react-router-dom";
import JSZip from "jszip";
import { saveAs } from "file-saver";
Expand Down Expand Up @@ -223,7 +223,7 @@ export default memo(function GanttChart() {

const saveData = async () => {
try {
const response = await fetch("http://localhost:8080/timetabling/update", {
const response = await fetch(REMOTE_API_URL + "/timetabling/update", {
method: "PUT",
headers: {
"Content-Type": "application/json",
Expand All @@ -238,7 +238,7 @@ export default memo(function GanttChart() {



fetch(LOCAL_API_URL + "/timetabling/view", { headers: { 'Authorization': authHeader } })
fetch(REMOTE_API_URL + "/timetabling/view", { headers: { 'Authorization': authHeader } })
.then((response) => {
if (!response.ok) {
throw new Error("Network response was not ok");
Expand Down

0 comments on commit 515d7bd

Please sign in to comment.