Move to monorepo for React Native!

This commit is contained in:
2025-09-12 16:44:21 -05:00
parent 4cafc11422
commit b1eae564be
144 changed files with 2535 additions and 311 deletions

View File

@@ -0,0 +1,17 @@
import { mutation, query } from './_generated/server';
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 }) => {
const url = await ctx.storage.getUrl(storageId);
return url ?? null;
},
});