如何在端点中用户使用一个苗条的商店变量?
我正在使用supabase作为我的后端,在我的终点,我想为通过.EQ方法登录的用户获取数据。
我的商店中有一个用户变量,但是
我不断遇到错误,因为我不知道如何访问用户并在尝试捕获中使用它。
例子
import {user} from ....
export const get= async() = {
try{
Const {data} = await supabase.from('post').select('*').eq('id', $user.id)
Return {
Body:{
data
}
}
}
}
Im using supabase for my back end and in my end point i want to fetch data for the user that is logged in via the .eq method.
I have a user variable in my store however
I keep getting errors because i dont know how to get access to user and use it in the try catch.
Example
import {user} from ....
export const get= async() = {
try{
Const {data} = await supabase.from('post').select('*').eq('id', $user.id)
Return {
Body:{
data
}
}
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论