feat: Add initial Electron frontend package.json with dependencies, scripts, and build configuration.
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import { mutation, query } from "./_generated/server";
|
||||
import { v } from "convex/values";
|
||||
import { getPublicStorageUrl, rewriteToPublicUrl } from "./storageUrl";
|
||||
|
||||
// Generate upload URL for client-side uploads
|
||||
export const generateUploadUrl = mutation({
|
||||
args: {},
|
||||
returns: v.string(),
|
||||
handler: async (ctx) => {
|
||||
return await ctx.storage.generateUploadUrl();
|
||||
const url = await ctx.storage.generateUploadUrl();
|
||||
return rewriteToPublicUrl(url);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -15,6 +17,6 @@ export const getFileUrl = query({
|
||||
args: { storageId: v.id("_storage") },
|
||||
returns: v.union(v.string(), v.null()),
|
||||
handler: async (ctx, args) => {
|
||||
return await ctx.storage.getUrl(args.storageId);
|
||||
return await getPublicStorageUrl(ctx, args.storageId);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user