chore: typescript version compatibilities and improvements
This commit is contained in:
@@ -40,14 +40,14 @@ const populate = async ({
|
||||
let populatedRelationship;
|
||||
|
||||
if (depth && currentDepth <= depth) {
|
||||
populatedRelationship = await payload.operations.collections.findByID({
|
||||
populatedRelationship = await payload.findByID({
|
||||
req,
|
||||
collection: relatedCollection,
|
||||
id: idString,
|
||||
collection: relatedCollection.config.slug,
|
||||
id: idString as string,
|
||||
depth,
|
||||
currentDepth: currentDepth + 1,
|
||||
overrideAccess,
|
||||
disableErrors: true,
|
||||
depth,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -39,12 +39,11 @@ const populate = async ({
|
||||
}) => {
|
||||
const dataRef = data as Record<string, unknown>;
|
||||
|
||||
const doc = await payload.operations.collections.findByID({
|
||||
req: {
|
||||
...req,
|
||||
payloadAPI: 'local',
|
||||
},
|
||||
collection,
|
||||
const newReq = { ...req, payloadAPI: 'local' } as PayloadRequest;
|
||||
|
||||
const doc = await payload.findByID({
|
||||
req: newReq,
|
||||
collection: collection.config.slug,
|
||||
id,
|
||||
currentDepth: currentDepth + 1,
|
||||
overrideAccess,
|
||||
|
||||
Reference in New Issue
Block a user