getUrl
getUrl<
TDataModel>(ctx,args):Promise<{error?:undefined;url:string; } | {error:string;url?:undefined; }>
Defined in: packages/file-storage-convex/src/adapter/methods.ts:87
Resolves a serving URL for a media document by looking up its storageId
and calling ctx.storage.getUrl().
Type Parameters
Section titled “Type Parameters”TDataModel
Section titled “TDataModel”TDataModel extends GenericDataModel = GenericDataModel
Parameters
Section titled “Parameters”GenericQueryCtx<TDataModel>
Convex query context.
collectionSlug and mediaId of the target media document.
collectionSlug
Section titled “collectionSlug”string
mediaId
Section titled “mediaId”string
Returns
Section titled “Returns”Promise<{ error?: undefined; url: string; } | { error: string; url?: undefined; }>
Promise resolving to { url } on success or { error } if the document or file is not found.