We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bccf67a commit 182463aCopy full SHA for 182463a
1 file changed
apps/web/src/hooks/useFindSession.ts
@@ -5,8 +5,8 @@ import axios from 'axios';
5
export const sessionInfo = async (sessionId: string): Promise<null | Session> => {
6
try {
7
const response = await axios.get(`/v1/sessions/${sessionId}`);
8
- const parsedResult = $Session.safeParse(response.data);
9
- return parsedResult.success ? parsedResult.data : null;
+ const parsedResult = await $Session.parseAsync(response.data);
+ return parsedResult;
10
} catch (error) {
11
console.error('Error fetching session:', error);
12
throw error;
0 commit comments