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

44 lines
1.4 KiB
Plaintext

import { preferencesCollectionSlug } from './config.js';
export const deleteUserPreferences = async ({ collectionConfig, ids, payload, req })=>{
if (collectionConfig.auth) {
await payload.db.deleteMany({
collection: preferencesCollectionSlug,
req,
where: {
or: [
{
and: [
{
'user.value': {
in: ids
}
},
{
'user.relationTo': {
equals: collectionConfig.slug
}
}
]
},
{
key: {
in: ids.map((id)=>`collection-${collectionConfig.slug}-${id}`)
}
}
]
}
});
} else {
await payload.db.deleteMany({
collection: preferencesCollectionSlug,
req,
where: {
key: {
in: ids.map((id)=>`collection-${collectionConfig.slug}-${id}`)
}
}
});
}
};
//# sourceMappingURL=deleteUserPreferences.js.map