fix: bad GetEntryImport
type
This commit is contained in:
parent
63b58119bb
commit
551f5ab56d
1 changed files with 5 additions and 4 deletions
|
@ -12,9 +12,10 @@ import {
|
|||
unescapeHTML,
|
||||
} from '../runtime/server/index.js';
|
||||
|
||||
type GlobResult = Record<string, () => Promise<any>>;
|
||||
type LazyImport = () => Promise<any>;
|
||||
type GlobResult = Record<string, LazyImport>;
|
||||
type CollectionToEntryMap = Record<string, GlobResult>;
|
||||
type GetEntryImport = (collection: string, lookupId: string) => () => Promise<any>;
|
||||
type GetEntryImport = (collection: string, lookupId: string) => Promise<LazyImport>;
|
||||
|
||||
export function createCollectionToGlobResultMap({
|
||||
globResult,
|
||||
|
@ -64,7 +65,7 @@ export function createGetCollection({
|
|||
return render({
|
||||
collection: entry.collection,
|
||||
id: entry.id,
|
||||
renderEntryImport: getRenderEntryImport(collection, entry.slug),
|
||||
renderEntryImport: await getRenderEntryImport(collection, entry.slug),
|
||||
});
|
||||
},
|
||||
};
|
||||
|
@ -117,7 +118,7 @@ async function render({
|
|||
}: {
|
||||
collection: string;
|
||||
id: string;
|
||||
renderEntryImport?: ReturnType<GetEntryImport>;
|
||||
renderEntryImport?: LazyImport;
|
||||
}) {
|
||||
const UnexpectedRenderError = new AstroError({
|
||||
...AstroErrorData.UnknownContentCollectionError,
|
||||
|
|
Loading…
Reference in a new issue