Files
klz-cables.com/.pnpm-store/v10/files/0f/6aead4679d9dc2b6a5cf564b3ce6feebcc7a5d7fe25c9c5b7e32eec0c2f4c1b8b6e8f99ca5bd5db6c48ad7f8bbfbfa96a7e9b368aa9b3ae294c88ddfcd700f
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

34 lines
1.3 KiB
Plaintext

import { APIError } from '../../../errors/index.js';
import { createLocalReq } from '../../../utilities/createLocalReq.js';
import { deleteOperation } from '../delete.js';
import { deleteByIDOperation } from '../deleteByID.js';
async function deleteLocal(payload, options) {
const { id, collection: collectionSlug, depth, disableTransaction, overrideAccess = true, overrideLock, populate, select, showHiddenFields, trash = false, where } = options;
const collection = payload.collections[collectionSlug];
if (!collection) {
throw new APIError(`The collection with slug ${String(collectionSlug)} can't be found. Delete Operation.`);
}
const args = {
id,
collection,
depth,
disableTransaction,
overrideAccess,
overrideLock,
populate,
req: await createLocalReq(options, payload),
select,
showHiddenFields,
trash,
where
};
if (options.id) {
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
return deleteByIDOperation(args);
}
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
return deleteOperation(args);
}
export { deleteLocal };
//# sourceMappingURL=delete.js.map