Add agent workflows & stuff
Build and Push Next App / quality (push) Failing after 48s
Build and Push Next App / build-next (push) Has been skipped

This commit is contained in:
Gabriel Brown
2026-06-21 21:15:15 -05:00
parent cf7ff2ee4e
commit 2dfa97ee4f
102 changed files with 8488 additions and 161 deletions
+12 -3
View File
@@ -1,6 +1,7 @@
import { getAuthUserId } from '@convex-dev/auth/server';
import { ConvexError, v } from 'convex/values';
import type { Id } from './_generated/dataModel';
import { mutation, query } from './_generated/server';
export const generateUploadUrl = mutation(async (ctx) => {
@@ -9,10 +10,18 @@ export const generateUploadUrl = mutation(async (ctx) => {
return await ctx.storage.generateUploadUrl();
});
const isRemoteImageUrl = (value: string) =>
value.startsWith('http://') || value.startsWith('https://');
export const getImageUrl = query({
args: { storageId: v.id('_storage') },
args: { storageId: v.string() },
handler: async (ctx, { storageId }) => {
const url = await ctx.storage.getUrl(storageId);
return url ?? null;
if (isRemoteImageUrl(storageId)) return storageId;
try {
const url = await ctx.storage.getUrl(storageId as Id<'_storage'>);
return url ?? null;
} catch {
return null;
}
},
});