You can now update your name or email from profiles page

This commit is contained in:
2025-09-04 09:43:16 -05:00
parent be23ea1070
commit 500da1f8be
9 changed files with 196 additions and 29 deletions

View File

@@ -1,13 +1,17 @@
import { mutation, query } from './_generated/server';
import { v } from 'convex/values';
import { ConvexError, v } from 'convex/values';
import { getAuthUserId } from '@convex-dev/auth/server';
export const generateUploadUrl = mutation(async (ctx) => {
const userId = await getAuthUserId(ctx);
if (!userId) throw new ConvexError('Not authenticated.');
return await ctx.storage.generateUploadUrl();
});
export const getImageUrl = query({
args: { storageId: v.id('_storage') },
handler: async (ctx, { storageId }) => {
return await ctx.storage.getUrl(storageId);
const url = await ctx.storage.getUrl(storageId);
return url ?? null;
},
});