Trying to add avatar upload. Project works rn so wanna push
This commit is contained in:
13
convex/files.ts
Normal file
13
convex/files.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { mutation, query } from "./_generated/server";
|
||||
import { v } from "convex/values";
|
||||
|
||||
export const generateUploadUrl = mutation(async (ctx) => {
|
||||
return await ctx.storage.generateUploadUrl();
|
||||
});
|
||||
|
||||
export const getImageUrl = query({
|
||||
args: { storageId: v.id("_storage") },
|
||||
handler: async (ctx, { storageId }) => {
|
||||
return await ctx.storage.getUrl(storageId);
|
||||
},
|
||||
});
|
Reference in New Issue
Block a user