Files
klz-cables.com/.pnpm-store/v10/files/4d/a7b95d3829edc3dfb4d28cf91087c3255984b3a539304b92630eba5b9be0d609379439604162d3520df63bd97493d70cb429423c655e30959825cba082ee00
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

40 lines
1.2 KiB
Plaintext

import { status as httpStatus } from 'http-status';
import { getRequestCollectionWithID } from '../../utilities/getRequestEntity.js';
import { headersWithCors } from '../../utilities/headersWithCors.js';
import { parseParams } from '../../utilities/parseParams/index.js';
import { deleteByIDOperation } from '../operations/deleteByID.js';
export const deleteByIDHandler = async (req)=>{
const { id, collection } = getRequestCollectionWithID(req);
const { depth, overrideLock, populate, select, trash } = parseParams(req.query);
const doc = await deleteByIDOperation({
id,
collection,
depth,
overrideLock: overrideLock ?? false,
populate,
req,
select,
trash
});
const headers = headersWithCors({
headers: new Headers(),
req
});
if (!doc) {
return Response.json({
message: req.t('general:notFound')
}, {
headers,
status: httpStatus.NOT_FOUND
});
}
return Response.json({
doc,
message: req.t('general:deletedSuccessfully')
}, {
headers,
status: httpStatus.OK
});
};
//# sourceMappingURL=deleteByID.js.map