File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 1111
1212export const getPost = async ( postId ) => {
1313 try {
14- // TODO: handle production and development environments
15- const response = await fetch ( `http://localhost:5173/api/post/${ postId } ` ) ;
14+ const response = await fetch ( `/api/post/${ postId } ` ) ;
1615 return await response . json ( ) ;
1716 } catch ( error ) {
1817 throw new Error ( 'Failed to load post: ' , error ) ;
@@ -21,10 +20,7 @@ export const getPost = async (postId) => {
2120
2221export const getComments = async ( postId ) => {
2322 try {
24- // TODO: handle production and development environments
25- const response = await fetch (
26- `http://localhost:5173/api/comments?postId=${ postId } ` ,
27- ) ;
23+ const response = await fetch ( `/api/comments?postId=${ postId } ` ) ;
2824 return await response . json ( ) ;
2925 } catch ( error ) {
3026 throw new Error ( 'Failed to load comments: ' , error ) ;
You can’t perform that action at this time.
0 commit comments