Files
klz-cables.com/.pnpm-store/v10/files/4c/78ed7ea507e8546af8a1af3e49b01e0d6fb3b04cb6f3d161de41e1ceb4b586baaddbbd42d6fcd2983225e74f97953a0f511a527fef1fed1b7b1d45c535299c
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

37 lines
859 B
Plaintext

import { preferencesCollectionSlug } from '../config.js';
export async function findOne(args) {
const { key, req: { payload }, req, user } = args;
if (!user) {
return null;
}
const where = {
and: [
{
key: {
equals: key
}
},
{
'user.value': {
equals: user.id
}
},
{
'user.relationTo': {
equals: user.collection
}
}
]
};
const { docs } = await payload.db.find({
collection: preferencesCollectionSlug,
limit: 1,
pagination: false,
req,
sort: '-updatedAt',
where
});
return docs?.[0] || null;
}
//# sourceMappingURL=findOne.js.map