use in pinia
Closed this issue · 2 comments
iranpourX commented
i can't use const client = useSanctumClient()
in pinia
Error: TypeError: client is not a function
manchenkoff commented
Hey @iranpourX, please re-create this issue with a Bug template and provide all necessary details in the description, including your code sample where you are trying to use this module, thanks!
AntonLugtenburg commented
initialize the client inyour pinia action. it does not behave like axios that you can register globally because its a composable in this case.
@manchenkoff correct me if im wrong...
actions: {
async fetchStuff(id) {
const client = useSanctumClient()