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

27 lines
1019 B
Plaintext

import { operationToHookOperation } from './types.js';
// Implementation
export async function buildBeforeOperation(operationArgs) {
const { args, collection, operation, overrideAccess } = operationArgs;
let newArgs = args;
if (args.collection.config.hooks?.beforeOperation?.length) {
// TODO: v4 should not need this mapping
// Map the operation to the hook operation type for backward compatibility
const hookOperation = operationToHookOperation[operation];
for (const hook of args.collection.config.hooks.beforeOperation){
const hookResult = await hook({
args: newArgs,
collection,
context: args.req.context,
operation: hookOperation,
overrideAccess,
req: args.req
});
if (hookResult !== undefined) {
newArgs = hookResult;
}
}
}
return newArgs;
}
//# sourceMappingURL=buildBeforeOperation.js.map