jaymeJ
Convex Community2y ago
5 replies
jayme

How do get userId to display on convex data table?

As title suggests, I am not sure why this is not showing up like it is for the guy in the other photo, I have follow his tutorial every step. here is the code for the file that i believe is using it.
import { v } from "convex/values";
import { mutation } from "./_generated/server";


export const createThumbnail = mutation ({
    args:{
        title: v.string(),
    },
    handler: async (ctx, args) => {
        const user = await ctx.auth.getUserIdentity();
        

        if (!user){
            throw new Error ("you must be logged in to create a thumbnail");
        }
        await ctx.db.insert('thumbnails', {
            title: args.title,
            userId: user.subject,

        });
    },
});
Screenshot_2024-07-21_192221.png
Screenshot_2024-07-21_192143.png
Was this page helpful?