Skip to content

Commit

Permalink
chore(no-release): fix code snippet on website to use authAction (#109
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tianhuil authored Apr 27, 2024
1 parent 5c7a45c commit c0f21a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions website/docs/safe-action-client/using-a-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ const schema = z.object({
username: z.string(),
})

export const deleteUser = action(schema, async ({ username }, { userId }) => {
export const deleteUser = authAction(schema, async ({ username }, { userId }) => {
// Action server code here...
},
{ middlewareData: { userRole: "admin" } } // type safe data
);
```
```

0 comments on commit c0f21a5

Please sign in to comment.