@@ -49,7 +49,7 @@ export default function TasksPage() {
4949 return ;
5050 }
5151 const auth = await fetch (
52- "http://localhost:8000/api/ planner/protected/",
52+ process . env . NEXT_PUBLIC_BACKEND_URL + " planner/protected/",
5353 {
5454 headers : {
5555 Authorization : `Bearer ${ token } ` ,
@@ -64,7 +64,7 @@ export default function TasksPage() {
6464 const user = await auth . json ( ) ;
6565 setUserId ( user . user_id ) ;
6666 const tasksFetch = await fetch (
67- `http://localhost:8000/api/ planner/tasks/`,
67+ process . env . NEXT_PUBLIC_BACKEND_URL + ` planner/tasks/`,
6868 {
6969 headers : {
7070 Authorization : `Bearer ${ token } ` ,
@@ -84,7 +84,7 @@ export default function TasksPage() {
8484 } , [ router ] ) ;
8585
8686 useEffect ( ( ) => {
87- fetch ( "http://localhost:8000/api/ planner/topic/")
87+ fetch ( process . env . NEXT_PUBLIC_BACKEND_URL + " planner/topic/")
8888 . then ( ( res ) => res . json ( ) )
8989 . then ( ( data ) => setAvailableTopics ( data ) )
9090 . catch ( ( err ) => console . error ( "Failed to load topics" , err ) ) ;
@@ -106,7 +106,8 @@ export default function TasksPage() {
106106
107107 try {
108108 const response = await fetch (
109- `http://localhost:8000/api/planner/tasks/${ id } /toggle_complete/` ,
109+ process . env . NEXT_PUBLIC_BACKEND_URL +
110+ `planner/tasks/${ id } /toggle_complete/` ,
110111 {
111112 method : "PATCH" ,
112113 headers : {
@@ -142,7 +143,7 @@ export default function TasksPage() {
142143
143144 try {
144145 const response = await fetch (
145- `http://localhost:8000/api/ planner/tasks/${ id } /`,
146+ process . env . NEXT_PUBLIC_BACKEND_URL + ` planner/tasks/${ id } /`,
146147 {
147148 method : "DELETE" ,
148149 headers : {
0 commit comments