Skip to content

Commit

Permalink
fix(frontend): getting apiUrl using utility method instead of hardcoding
Browse files Browse the repository at this point in the history
  • Loading branch information
MAXOUXAX committed Jan 24, 2024
1 parent 1a93056 commit 852c9d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion expo/components/RoomHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -29,9 +30,11 @@ const RoomHistory: React.FC<RoomHistoryProps> = ({ 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: {
Expand Down

0 comments on commit 852c9d2

Please sign in to comment.