Skip to content

Commit

Permalink
docs: update tasks return value
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux authored Mar 20, 2024
1 parent 90434ec commit 8a62e7d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/1.guide/10.tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default defineTask({
},
run({ payload, context }) {
console.log("Running DB migration task...");
return "Success";
return { result: "Success" };
},
});
```
Expand Down Expand Up @@ -108,6 +108,7 @@ export default eventHandler(async (event) => {
// IMPORTANT: Authenticate user and validate payload!
const payload = { ...getQuery(event) };
const { result } = await runTask("db:migrate", { payload });

return { result };
});
```
Expand Down Expand Up @@ -157,7 +158,7 @@ export default defineTask({
},
run({ payload, context }) {
console.log("Running echo task...");
return payload;
return { result: payload };
},
});
```
Expand Down

0 comments on commit 8a62e7d

Please sign in to comment.