Skip to content

Commit 275aa38

Browse files
committed
docs: fix deleteObject reference
1 parent cc987fd commit 275aa38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

341341
const 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
```

0 commit comments

Comments
 (0)