Toast Error not displaying

Want to pass an error toast if data is not found in the database but status response is 200.Below is what I implemented but does not show a toast
const searchUser=useCallback(async()=>{


const data = await supabase.from('profiles').select('name').eq('name',search)
if(data){
setCuser(data.data)
}
else{
toast.error('User not found')
}

},[search])
const searchUser=useCallback(async()=>{


const data = await supabase.from('profiles').select('name').eq('name',search)
if(data){
setCuser(data.data)
}
else{
toast.error('User not found')
}

},[search])
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server