Closed dethdkn closed 7 months ago
Thank you for the PR @dethdkn
Don't you want to translate on the application side instead of the API @dethdkn ?
Hey @Atinux I translate both 😅, Most of my $fetch are like this
const res = await $fetch('/do-something', { method: 'post', body: body.data })
.catch((err) => { toast.add({ title: err.data.message, icon: 'i-heroicons-exclamation-triangle', color: 'red' }) })
I get the returned api message and show it as a toast I'm not sure if it's the best way to work with $fetch catch, but, it has been working here since my api have multiple throws.
Also sorry for the inconsistent spacing on the opts type, I thought eslint would fix that
Happy to fix the conflicts with the new eslint rules? see #79
Fixed @Atinux 🫡
Hello, This PR introduces the ability to customize the status code and error message in the
requireUserSession
method. This feature is particularly useful for applications that are not in English.I use the returned error message on my apps, and I wish I could translate the
Unauthorized
message to my language