fix(mobile): onError på 15 mutationer – inga tysta miss (MIKRO 52)
CI / Typecheck, test & build (push) Successful in 1m37s

This commit is contained in:
Sven (AAMOS AI)
2026-08-14 18:03:36 +07:00
parent ea1f9a113a
commit 491daace86
6 changed files with 32 additions and 2 deletions
+4
View File
@@ -83,12 +83,16 @@ export default function RecipeScreen() {
mutationFn: (isFavorite: boolean) =>
api(`/v1/recipes/${id}/favorite`, { method: isFavorite ? "DELETE" : "POST" }),
onSuccess: () => void queryClient.invalidateQueries({ queryKey: ["recipe", id] }),
onError: (err) =>
Alert.alert(t("common.oops"), err instanceof Error ? err.message : t("common.error")),
});
const rate = useMutation({
mutationFn: (stars: number) =>
api(`/v1/recipes/${id}/rate`, { method: "POST", body: { stars, feedbackTags: [] } }),
onSuccess: () => void queryClient.invalidateQueries({ queryKey: ["recipe", id] }),
onError: (err) =>
Alert.alert(t("common.oops"), err instanceof Error ? err.message : t("common.error")),
});
if (query.isLoading) return <LoadingView />;