-
Notifications
You must be signed in to change notification settings - Fork 403
Open
Description
Convex combined with convex-auth. I override and extend the users table in authTables in the schema, but I can't get the type of the extended field in the function
schema.ts
import { authTables } from '@convex-dev/auth/server'
import { defineSchema, defineTable } from 'convex/server'
import { v } from 'convex/values'
const schema = defineSchema({
...authTables,
users: defineTable({
email: v.optional(v.string()),
image: v.optional(v.string()),
isAnonymous: v.optional(v.boolean()),
name: v.optional(v.string()),
phone: v.optional(v.string()),
role: v.optional(v.string()),
parentId: v.optional(v.id('users')),
status: v.optional(v.string()), // 用户状态,例如 'active', 'inactive'
})
.index('email', ['email'])
.index('parentId', ['parentId']),
export default schema
users.ts
import { createAccount, type Doc, getAuthUserId, modifyAccountCredentials } from '@convex-dev/auth/server'
import { v } from 'convex/values'
import { api, internal } from './_generated/api'
import { action, internalMutation, internalQuery, mutation, query } from './_generated/server'
type ReturnUser = Doc<'users'>

Is this normal?thank you
Metadata
Metadata
Assignees
Labels
No labels