Files
klz-cables.com/.pnpm-store/v10/files/fa/d4c33ad1b4ad4865c9cc720985d942829d29bbf0dcda5b2229bdc795390fa769ec764a7f45f69ed6fedb1cf0307b546d13484c6c95631a5f83960e3526c290
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

37 lines
1.4 KiB
Plaintext

import { findOperation, isolateObjectProperty } from 'payload';
import { buildSelectForCollectionMany } from '../../utilities/select.js';
export function findResolver(collection) {
return async function resolver(_, args, context, info) {
const req = context.req = isolateObjectProperty(context.req, [
'locale',
'fallbackLocale',
'transactionID'
]);
const select = context.select = args.select ? buildSelectForCollectionMany(info) : undefined;
req.locale = args.locale || req.locale;
req.fallbackLocale = args.fallbackLocale || req.fallbackLocale;
req.query = req.query || {};
const draft = args.draft ?? req.query?.draft === 'false' ? false : req.query?.draft === 'true' ? true : undefined;
if (typeof draft === 'boolean') {
req.query.draft = String(draft);
}
const { sort } = args;
const options = {
collection,
depth: 0,
draft: args.draft,
limit: args.limit,
page: args.page,
pagination: args.pagination,
req,
select,
sort: sort && typeof sort === 'string' ? sort.split(',') : undefined,
trash: args.trash,
where: args.where
};
const result = await findOperation(options);
return result;
};
}
//# sourceMappingURL=find.js.map