jayme
jayme6mo ago

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,

});
},
});
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,

});
},
});
No description
No description
4 Replies
jayme
jaymeOP6mo ago
I dont have access to it because convex isnt allowing me to verfiy my discord
Matt Luo
Matt Luo6mo ago
Ah, that is in the Convex + Clerk tutorial, I believe. YOu can also look at web dev cody's github repo in the Templates part of the Convex website
jayme
jaymeOP6mo ago
his repo can be found from the convex website? also, is there any reason why the userid isnt generating? is there something im not doing in the terminal? I followed his tutorial step by step so I don't really understand why its not working
ian
ian6mo ago
I don't think his repo is in templates but it's probably linked from the video & on https://github.com/webdevcody/ somewhere
Templates
Use a recipe to get started quickly.
GitHub
webdevcody - Overview
webdevcody has 61 repositories available. Follow their code on GitHub.

Did you find this page helpful?