Files
klz-cables.com/.pnpm-store/v10/files/b6/9976ffab198741ef4dc2c63c7b8edab6529766ba0cbeb98c40bf2cb89cf53fbe79fedac9bd023daecfde4fd44b3f6523fb81c731ccb271cac52a511830475c
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

23 lines
815 B
Plaintext

import { countOperation, isolateObjectProperty } from 'payload';
export function countResolver(collection) {
return async function resolver(_, args, context) {
let { req } = context;
const locale = req.locale;
const fallbackLocale = req.fallbackLocale;
req = isolateObjectProperty(req, 'locale');
req = isolateObjectProperty(req, 'fallbackLocale');
req.locale = args.locale || locale;
req.fallbackLocale = fallbackLocale;
context.req = req;
const options = {
collection,
req: isolateObjectProperty(req, 'transactionID'),
trash: args.trash,
where: args.where
};
const results = await countOperation(options);
return results;
};
}
//# sourceMappingURL=count.js.map