Files
klz-cables.com/.pnpm-store/v10/files/61/8d74f8cd8d235c4993ab94e5277c0249af05c83716d0d943a254c2352eb6df7ff40175c9c2eaaf69351337438fd9ef2f83cdcda0525e15d3f0b2096d5fab65
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 { 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 { updateByIDOperation } from '../operations/updateByID.js';
export const updateByIDHandler = async (req)=>{
const { id, collection } = getRequestCollectionWithID(req);
const { autosave, depth, draft, overrideLock, populate, publishAllLocales, publishSpecificLocale, select, trash, unpublishAllLocales } = parseParams(req.query);
const doc = await updateByIDOperation({
id,
autosave,
collection,
data: req.data,
depth,
draft,
overrideLock: overrideLock ?? false,
populate,
publishAllLocales,
publishSpecificLocale,
req,
select,
trash,
unpublishAllLocales
});
let message = req.t('general:updatedSuccessfully');
if (draft) {
message = req.t('version:draftSavedSuccessfully');
}
if (autosave) {
message = req.t('version:autosavedSuccessfully');
}
return Response.json({
doc,
message
}, {
headers: headersWithCors({
headers: new Headers(),
req
}),
status: httpStatus.OK
});
};
//# sourceMappingURL=updateByID.js.map