小编Nik*_*her的帖子

Supabase:如何通过电子邮件查询用户?

我在 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?

有人能把我推向正确的方向吗?

谢谢,

尼科

postgresql node.js supabase

6
推荐指数
2
解决办法
7401
查看次数

Vuex:getters 应该是函数,但模块“customer”中的“getters.default”是 {}

我在几个模块中构建了我的 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)

javascript vue.js vuex

5
推荐指数
1
解决办法
5496
查看次数

标签 统计

javascript ×1

node.js ×1

postgresql ×1

supabase ×1

vue.js ×1

vuex ×1