Skip to content

Commit db53c16

Browse files
committed
chore: update parse to parseAsync in useFindSessionQuery
1 parent a98c43f commit db53c16

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

apps/web/src/hooks/useFindSessionQuery.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ export const useFindSessionQuery = (
2626
const response = await axios.get('/v1/sessions', {
2727
params
2828
});
29-
const parsedData = $SessionWithUser.array().safeParseAsync(response.data);
30-
if ((await parsedData).error) {
31-
const message = (await parsedData).error?.message;
32-
throw new Error(message);
33-
}
34-
return (await parsedData).data;
29+
return $SessionWithUser.array().parseAsync(response.data);
3530
},
3631
queryKey: ['sessions', ...Object.values(params)]
3732
});

0 commit comments

Comments
 (0)