From 852c9d2399431cbe8fe1d9d102731d6c8372f84c Mon Sep 17 00:00:00 2001 From: MAXOUXAX <24844231+MAXOUXAX@users.noreply.github.com> Date: Wed, 24 Jan 2024 09:31:49 +0100 Subject: [PATCH] fix(frontend): getting apiUrl using utility method instead of hardcoding --- expo/components/RoomHistory.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/expo/components/RoomHistory.tsx b/expo/components/RoomHistory.tsx index 1518eb10..b6b77ea8 100644 --- a/expo/components/RoomHistory.tsx +++ b/expo/components/RoomHistory.tsx @@ -6,6 +6,7 @@ import { StyleSheet } from "react-native"; import InfoCard from "./InfoCard"; import { Text, View } from "./Tamed"; +import { getApiUrl } from "../lib/apiUrl"; import useSupabaseUser from "../lib/useSupabaseUser"; type RoomHistoryProps = { @@ -29,9 +30,11 @@ const RoomHistory: React.FC = ({ roomId }) => { fetchUser(); }, []); + const apiUrl = getApiUrl(); + useEffect(() => { const fetchProcessedRoomData = async () => { - const data = await fetch(`http://localhost:3000/rooms/${roomId}`, { + const data = await fetch(`${apiUrl}/rooms/${roomId}`, { method: "GET", credentials: "include", headers: {