Skip to content

Commit aa7de4c

Browse files
Copilothotlong
andcommitted
Fix hook event naming in AI coding assistant guide
Co-authored-by: hotlong <[email protected]>
1 parent 69d596c commit aa7de4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/docs/ai/coding-assistant.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ app.registerAction('todo', 'complete_all', async (ctx) => {
164164

165165
**Hooks (Triggers):**
166166
```typescript
167-
// Valid events: beforeCreate, afterCreate, beforeUpdate, afterUpdate, beforeDelete, etc.
168-
app.on('beforeCreate', 'todo', async (ctx) => {
167+
// Valid events: before:create, after:create, before:update, after:update, before:delete, etc.
168+
app.on('before:create', 'todo', async (ctx) => {
169169
// ctx.data contains the payload for create/update
170170
if (!ctx.data.title) {
171171
throw new Error("Title is required");

0 commit comments

Comments
 (0)