swajpS
Convex Community2y ago
1 reply
swajp

how can i access the roomCode and redirect user

export const create = mutation({
    handler: async ctx => {
        const game = await ctx.db.insert("games", {
            roomCode: generateRoomCode(),
            round: 1,
            currentWord: generateRandomWord()
        })

        return game
    }
})


   const onCreate = () => {
        create().then(room => {
            router.push(`/game/${room.roomCode}`)
        })
    }


and i get
Property 'roomCode' does not exist on type 'string & { __tableName: "games"; }'.ts(2339)
Was this page helpful?