kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
refactor: use statusSchema.parse rather than statusSchema.safeParse
we want to throw any errors so they are catchedmerge-requests/3297/head
rodzic
2acb8e601d
commit
d2126f60f2
|
@ -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) {
|
||||
|
|
Ładowanie…
Reference in New Issue