NuxtN
Nuxt2y ago
Prem

`$fetch` error handling.

Hi,

is this how i'm supposed call POST API call?

try {
    await $fetch("/api/auth/login", {
        method: "POST",
        body: data
    });
} catch (error) {
    console.log(error?.data?.message);
}
Screenshot_2024-06-21_at_3.32.51_AM.png
Was this page helpful?