diff --git a/web/docs/tutorials/todo-app/05-updating-tasks.md b/web/docs/tutorials/todo-app/05-updating-tasks.md index 799278e1f..c941d03bb 100644 --- a/web/docs/tutorials/todo-app/05-updating-tasks.md +++ b/web/docs/tutorials/todo-app/05-updating-tasks.md @@ -67,11 +67,11 @@ Let's now define the Action's JavaScript implementation in `src/server/actions.t ```js title="src/server/actions.js" // ... -export const updateTask = async ({ id, isDone }, context) => { +export const updateTask = async (args, context) => { return context.entities.Task.update({ - where: { id }, + where: { args.id }, data: { - isDone: isDone, + isDone: args.isDone, }, }) } @@ -89,13 +89,13 @@ import { CreateTask, UpdateTask } from "@wasp/actions/types" type UpdateTaskPayload = Pick export const updateTask: UpdateTask = async ( - { id, isDone }, + args, context ) => { return context.entities.Task.update({ - where: { id }, + where: { args.id }, data: { - isDone: isDone, + isDone: args.isDone, }, }) } diff --git a/web/docs/tutorials/todo-app/06-auth.md b/web/docs/tutorials/todo-app/06-auth.md index 7c11926cf..d1f091917 100644 --- a/web/docs/tutorials/todo-app/06-auth.md +++ b/web/docs/tutorials/todo-app/06-auth.md @@ -382,15 +382,15 @@ export const createTask: CreateTask = async ( type UpdateTaskPayload = Pick export const updateTask: UpdateTask = async ( - { id, isDone }, + args, context ) => { if (!context.user) { throw new HttpError(401) } return context.entities.Task.updateMany({ - where: { id: args.taskId, user: { id: context.user.id } }, - data: { isDone: args.data.isDone } + where: { id: args.id, user: { id: context.user.id } }, + data: { isDone: args.isDone } }) } ```