Files
klz-cables.com/.pnpm-store/v10/files/db/d6036f411775719023502f7be681e6892b8e97628590b8cc5bff729731ed2a2e7220c22bc34baebc1946b6dbf90a838f368dc8702c5616aba33e705824fdb8
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

22 lines
754 B
Plaintext

import { duplicateOperation, isolateObjectProperty } from 'payload';
export function duplicateResolver(collection) {
return async function resolver(_, args, context) {
const { req } = context;
const locale = req.locale;
const fallbackLocale = req.fallbackLocale;
req.locale = args.locale || locale;
req.fallbackLocale = args.fallbackLocale || fallbackLocale;
context.req = req;
const result = await duplicateOperation({
id: args.id,
collection,
data: args.data,
depth: 0,
draft: args.draft,
req: isolateObjectProperty(req, 'transactionID')
});
return result;
};
}
//# sourceMappingURL=duplicate.js.map