assets without objects
This commit is contained in:
@@ -6,8 +6,6 @@ import type {
|
||||
GetAsset as AssetManagerGetAsset,
|
||||
} from '../asset_manager';
|
||||
|
||||
const BASE_FETCH_OPTIONS = { start: 1, limit: 1 } as const;
|
||||
|
||||
interface DocumentVersion extends DocumentVersionLike {
|
||||
download_path?: string | null;
|
||||
}
|
||||
@@ -22,7 +20,7 @@ export type EnsurePreviewData = (id: string | number) => Promise<DocumentLike |
|
||||
export type EnsureAssetUrl = (
|
||||
id: string | number,
|
||||
asset: AssetLike,
|
||||
options?: { start?: number; limit?: number; force?: boolean },
|
||||
options?: { force?: boolean },
|
||||
) => Promise<AssetLike | null>;
|
||||
export type GetDocumentAsset = AssetManagerGetAsset;
|
||||
|
||||
@@ -70,7 +68,7 @@ export async function resolveOcrTextUrl({
|
||||
|
||||
let entry: AssetLike = asset;
|
||||
if (ensureAssetUrl) {
|
||||
const ensureOptions = { ...BASE_FETCH_OPTIONS, force: !hasUrl };
|
||||
const ensureOptions = { force: !hasUrl };
|
||||
const ensured = await ensureAssetUrl(docRef.id!, asset, ensureOptions);
|
||||
if (ensured) {
|
||||
entry = ensured;
|
||||
@@ -87,8 +85,7 @@ export async function resolveOcrTextUrl({
|
||||
resolveDocumentAssetUrl(docRef, 'ocr-text', {
|
||||
ensureAssetUrl,
|
||||
getAsset: getDocumentAsset,
|
||||
ensureOptions: { ...BASE_FETCH_OPTIONS, force: true },
|
||||
objectOrdinal: 1,
|
||||
ensureOptions: { force: true },
|
||||
}) || null
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user