Skip to content

Commit 47870b9

Browse files
Update src/content/docs/agents/api-reference/store-and-sync-state.mdx
1 parent 8b9c33a commit 47870b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/docs/agents/api-reference/store-and-sync-state.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export class MyAgent extends Agent<Env> {
211211
let userId = new URL(request.url).searchParams.get('userId');
212212
// Supply the type parameter to the query when calling this.sql
213213
// This assumes the results returns one or more User rows with "id", "name", and "email" columns
214-
const user = this.sql<User>`SELECT * FROM users WHERE id = ${userId}`;
214+
const [user] = this.sql<User>`SELECT * FROM users WHERE id = ${userId}`;
215215
return Response.json(user)
216216
}
217217
}

0 commit comments

Comments
 (0)