File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -330,7 +330,7 @@ function Image({ message }: { message: { url: string } }) {
330330
331331## Deleting Files
332332
333- Files stored in R2 can be deleted from actions via the ` r2.delete ` function, which accepts an object key.
333+ Files stored in R2 can be deleted from actions or mutations via the ` r2.deleteObject ` function, which accepts an object key.
334334
335335``` ts
336336// convex/images.ts
@@ -340,12 +340,12 @@ import { R2 } from "@convex-dev/r2";
340340
341341const r2 = new R2 (components .r2 );
342342
343- export const deleteByKey = mutation ({
343+ export const deleteObject = mutation ({
344344 args: {
345345 key: v .string (),
346346 },
347347 handler : async (ctx , args ) => {
348- return await r2 .deleteByKey ( args .key );
348+ return await r2 .deleteObject ( ctx , args .key );
349349 },
350350});
351351```
You can’t perform that action at this time.
0 commit comments