Skip to content

Commit

Permalink
fix: fix incorrect return type for useManyDocs() (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 authored Jan 13, 2025
1 parent a423989 commit f83353f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ Retrieve all documents of a specific `docType`.

| Function | Type |
| ---------- | ---------- |
| `useManyDocs` | `<D extends WriteableDocumentType>({ projectId, docType, includeDeleted, lang, }: { projectId: string; docType: D; includeDeleted?: boolean or undefined; lang?: string or undefined; }) => ReadHookResult<Extract<{ schemaName: "deviceInfo"; name: string; deviceType: "device_type_unspecified" or ... 4 more ... or "UNRECOGNI...` |
| `useManyDocs` | `<D extends WriteableDocumentType>({ projectId, docType, includeDeleted, lang, }: { projectId: string; docType: D; includeDeleted?: boolean or undefined; lang?: string or undefined; }) => ReadHookResult<(Extract<{ schemaName: "deviceInfo"; name: string; deviceType: "device_type_unspecified" or ... 4 more ... or "UNRECOGN...` |

Parameters:

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function useManyDocs<D extends WriteableDocumentType>({
docType: D
includeDeleted?: boolean
lang?: string
}): ReadHookResult<Extract<MapeoDoc, { schemaName: D }>> {
}): ReadHookResult<Array<Extract<MapeoDoc, { schemaName: D }>>> {
const { data: projectApi } = useSingleProject({ projectId })

const { data, error, isRefetching } = useSuspenseQuery(
Expand Down

0 comments on commit f83353f

Please sign in to comment.