我在 Node JS 中间件中使用 Supabase。我正在开发一个邀请功能,该功能通过 REST 端点接收现有 supabase 用户的电子邮件地址。现在它应该查询用户表以获得用户 ID。但这似乎不起作用:
(我使用 Supabase JavaScript 库和绕过行级安全性的管理密钥):
const { createClient, } = require('@supabase/supabase-js')
const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_KEY)
supabase
.from('users')
.select('id')
.eq('email', 'doe@example.com')
.then(response => {
console.log(response)
})
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
'关系“public.users”不存在'
我也尝试过查询
supabase
.from('users')
.select('id')
.eq('email', 'doe@example.com')
.then(response => {
console.log(response)
})
Run Code Online (Sandbox Code Playgroud)
但这也失败了。貌似无法查询users表。
我究竟做错了什么?如何通过给定的电子邮件查询用户 ID?
有人能把我推向正确的方向吗?
谢谢,
尼科
我在几个模块中构建了我的 Vuex 存储,现在我面临着一个奇怪的 Vuex 错误,我无法解决:
Uncaught Error: [vuex] getters should be function but "getters.default" in module "customer" is {}.
at assert (vuex.esm.js?358c:97)
at eval (vuex.esm.js?358c:271)
at eval (vuex.esm.js?358c:85)
at Array.forEach (<anonymous>)
at forEachValue (vuex.esm.js?358c:85)
at eval (vuex.esm.js?358c:270)
at Array.forEach (<anonymous>)
at assertRawModule (vuex.esm.js?358c:265)
at ModuleCollection.register (vuex.esm.js?358c:191)
at eval (vuex.esm.js?358c:205)
Run Code Online (Sandbox Code Playgroud)
我的 Vuex 商店的结构基于以下模式构建
- store
-- index.js
-- modules
--- customer
---- index.js
---- actions.js
---- getters.js
---- mutations.js
Run Code Online (Sandbox Code Playgroud)
这是我的基本index.js:
import Vue from 'vue'
import Vuex from 'vuex'
import customerModule from …Run Code Online (Sandbox Code Playgroud)