diff --git a/src/lib/react-query/documents.ts b/src/lib/react-query/documents.ts index 12647c4..d835b41 100644 --- a/src/lib/react-query/documents.ts +++ b/src/lib/react-query/documents.ts @@ -97,7 +97,7 @@ export function documentByDocumentIdQueryOptions({ projectId: string docType: D docId: Parameters[0] - opts?: Parameters[1] + opts?: Omit[1], 'mustBeFound'> }) { return queryOptions({ ...baseQueryOptions(), @@ -108,7 +108,11 @@ export function documentByDocumentIdQueryOptions({ opts, }), queryFn: async () => { - return projectApi[docType].getByDocId(docId, opts) + return projectApi[docType].getByDocId(docId, { + ...opts, + // We want to make sure that this throws in the case that no match is found + mustBeFound: true, + }) }, }) }