export const add = mutation({
args: {},
handler: async (ctx) => {
const identity = await ctx.auth.getUserIdentity()
if (identity === null) {
throw new Error("Not authenticated")
}
const userId = await ctx.db.insert("users", { name: "John Doe" })
return userId
},
})
export const add = mutation({
args: {},
handler: async (ctx) => {
const identity = await ctx.auth.getUserIdentity()
if (identity === null) {
throw new Error("Not authenticated")
}
const userId = await ctx.db.insert("users", { name: "John Doe" })
return userId
},
})