fix: 'items.map is not a function' in 'search' tool #7
Reference in New Issue
Block a user
Delete Branch "main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Error: docmost__search failed with items.map is not a function because the code assumed response.data.data is always an array. In some Docmost deployments, search results are returned as response.data.data.items.
Fix: Normalize the search response before mapping: accept both formats (data as array or data.items as array), and fall back to an empty array if neither is present.
Pull request closed