Files
klz-cables.com/.pnpm-store/v10/files/6b/90cf8ce80463380bab906cf8c1f7b1feb26b3dedb12f2d0fe0e4edcde4e8265a0eb4164f5556a142b9e8476173f8fd462f8f742c039f1b0693a82ad4152264
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

31 lines
1011 B
Plaintext

import { status as httpStatus } from 'http-status';
import { deleteOperation } from '../operations/delete.js';
export const deleteHandler = async (incomingReq)=>{
// We cannot import the addDataAndFileToRequest utility here from the 'next' package because of dependency issues
// However that utility should be used where possible instead of manually appending the data
let data;
try {
data = await incomingReq.json?.();
} catch (ignore) {
data = {};
}
const reqWithData = incomingReq;
if (data) {
reqWithData.data = data;
// @ts-expect-error
reqWithData.json = ()=>Promise.resolve(data);
}
const result = await deleteOperation({
key: reqWithData.routeParams?.key,
req: reqWithData,
user: reqWithData.user
});
return Response.json({
...result,
message: reqWithData.t('general:deletedSuccessfully')
}, {
status: httpStatus.OK
});
};
//# sourceMappingURL=delete.js.map