sistema-de-chamados/web/convex/files.ts

18 lines
424 B
TypeScript

import { action, query } from "./_generated/server";
import { v } from "convex/values";
export const generateUploadUrl = action({
args: {},
handler: async (ctx) => {
return await ctx.storage.generateUploadUrl();
},
});
export const getUrl = query({
args: { storageId: v.id("_storage") },
handler: async (ctx, { storageId }) => {
const url = await ctx.storage.getUrl(storageId);
return url;
},
});