refactor: use statusSchema.parse rather than statusSchema.safeParse
we want to throw any errors so they are catched
This commit is contained in:
parent
2acb8e601d
commit
d2126f60f2
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue