Intercept the user endpoint response #194
-
Hi, I was just wondering if there is a way to interact/intercept the For example, my
But I want to make available in the composer only
Removing the age. Of course, it was just an hypothetical example. Great plugin |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hey @tiagomatosweb, there are two options depending on what you actually want to achieve:
|
Beta Was this translation helpful? Give feedback.
-
Using the global interceptor as you described on item 2 worked well. |
Beta Was this translation helpful? Give feedback.
Hey @tiagomatosweb, there are two options depending on what you actually want to achieve:
useSanctumUser
is a generic composable, so you can type it with a specific type/interface and your IDE will do the rest. However, you can still access other object properties even if they are not highlighted in the code. You can check example in the docsonResponse
and check if the request is yourendpoints.user
, then try to changeresponse
object. However, I never tried doing so, not sure how ofetch handles it. You can check another example in the docs as well