refactor: use statusSchema.parse rather than statusSchema.safeParse

we want to throw any errors so they are catched
This commit is contained in:
P. Reis 2024-12-18 21:16:08 -03:00
parent 2acb8e601d
commit d2126f60f2
1 changed files with 3 additions and 3 deletions

View File

@ -59,9 +59,9 @@ function useBookmark() {
try { try {
const response = await api.post(`/api/v1/statuses/${statusId}/bookmark`); const response = await api.post(`/api/v1/statuses/${statusId}/bookmark`);
const result = statusSchema.safeParse(await response.json()); const result = statusSchema.parse(await response.json());
if (result.success) { if (result) {
dispatch(importEntities([result.data], Entities.STATUSES, 'bookmarks', 'start')); dispatch(importEntities([result], Entities.STATUSES, 'bookmarks', 'start'));
} }
return { success: true }; return { success: true };
} catch (e) { } catch (e) {