Skip to content

Commit

Permalink
Merge branch 'development_branch' of https://github.com/CS3219-AY2425…
Browse files Browse the repository at this point in the history
…S1/cs3219-ay2425s1-project-g38 into development_branch
  • Loading branch information
jayllo-c committed Nov 9, 2024
2 parents afa1c4a + 9e045ab commit b0aaa63
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { getSessionDetails } from "@/services/sessionAPI";
const SessionDetailsPage: React.FC = () => {
const [sessionData, setSessionData] = useState<any>(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
const params = useParams();
const searchParams = useSearchParams();
const sessionId = params.sessionId as string;
Expand All @@ -42,6 +43,7 @@ const SessionDetailsPage: React.FC = () => {
setSessionData(result.data);
} else {
console.error(result.message);
setError(result.message);
}
} catch (error) {
console.error("Error fetching session details:", error);
Expand Down Expand Up @@ -78,7 +80,7 @@ const SessionDetailsPage: React.FC = () => {
}

if (!sessionData) {
return <div>Error loading session details.</div>;
return <div>{error}</div>;
}

const { question, attemptCode, dateCreated, language } = sessionData;
Expand Down

0 comments on commit b0aaa63

Please sign in to comment.