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

39 lines
991 B
Plaintext

import { NotFound } from '../../errors/NotFound.js';
import { UnauthorizedError } from '../../errors/UnauthorizedError.js';
import { preferencesCollectionSlug } from '../config.js';
export async function deleteOperation(args) {
const { key, req: { payload }, req, user } = args;
if (!user) {
throw new UnauthorizedError(req.t);
}
const where = {
and: [
{
key: {
equals: key
}
},
{
'user.value': {
equals: user.id
}
},
{
'user.relationTo': {
equals: user.collection
}
}
]
};
const result = await payload.db.deleteOne({
collection: preferencesCollectionSlug,
req,
where
});
if (result) {
return result;
}
throw new NotFound(req.t);
}
//# sourceMappingURL=delete.js.map