refactor: use statusSchema.parse rather than statusSchema.safeParse

we want to throw any errors so they are catched
merge-requests/3297/head
P. Reis 2024-12-18 21:16:08 -03:00
rodzic 2acb8e601d
commit d2126f60f2
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

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