Skip to content

Commit 895197b

Browse files
committed
chore: revert session schema and parse change
1 parent 182463a commit 895197b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

apps/web/src/hooks/useFindSession.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { $Session } from '@opendatacapture/schemas/session';
21
import type { Session } from '@opendatacapture/schemas/session';
32
import axios from 'axios';
43

54
export const sessionInfo = async (sessionId: string): Promise<null | Session> => {
65
try {
76
const response = await axios.get(`/v1/sessions/${sessionId}`);
8-
const parsedResult = await $Session.parseAsync(response.data);
9-
return parsedResult;
7+
if (!response.data) {
8+
throw new Error('Session data does not exist');
9+
}
10+
return response.data as Session;
1011
} catch (error) {
1112
console.error('Error fetching session:', error);
1213
throw error;

0 commit comments

Comments
 (0)