From ac75a51f9dbc2f61ba4aa1ef05b4001741290259 Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Thu, 16 Apr 2026 11:34:21 -0300 Subject: [PATCH] refactor: use Inertia useHttp for brand autofill request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Brand.vue autofill was hitting the endpoint with a raw fetch() call including manual CSRF header wiring, content-type boilerplate, and error parsing. Inertia v3 ships useHttp() for standalone HTTP requests that handles all of that natively — matching the convention already used elsewhere in the app (YouTubeAnalytics, XAnalytics, InstagramAnalytics). Typed the payload and response shape so the composable gives us type-safe access to the fields we care about. Error handling now reads from the Inertia exception's response.data.message. --- resources/js/pages/onboarding/Brand.vue | 48 ++++++++++++------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/resources/js/pages/onboarding/Brand.vue b/resources/js/pages/onboarding/Brand.vue index a0f1626f..7e460b77 100644 --- a/resources/js/pages/onboarding/Brand.vue +++ b/resources/js/pages/onboarding/Brand.vue @@ -1,5 +1,5 @@