Files
klz-cables.com/.pnpm-store/v10/files/3a/689ef0c0ae0ab76a4fad2ed4e2e360797ed47264c8c33338dd61dc40d94dab575786d7550f9a69f5a19029ae64b6ea4408dd133571cabb3fc060e3eea2d81a
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
1.2 KiB
Plaintext

import { getTranslation } from '@payloadcms/translations';
import { status as httpStatus } from 'http-status';
import { getRequestCollection } from '../../utilities/getRequestEntity.js';
import { headersWithCors } from '../../utilities/headersWithCors.js';
import { parseParams } from '../../utilities/parseParams/index.js';
import { createOperation } from '../operations/create.js';
export const createHandler = async (req)=>{
const collection = getRequestCollection(req);
const { autosave, depth, draft, populate, publishAllLocales, select } = parseParams(req.query);
const publishSpecificLocale = req.query.publishSpecificLocale;
const doc = await createOperation({
autosave,
collection,
data: req.data,
depth,
draft,
populate,
publishAllLocales,
publishSpecificLocale,
req,
select
});
return Response.json({
doc,
message: req.t('general:successfullyCreated', {
label: getTranslation(collection.config.labels.singular, req.i18n)
})
}, {
headers: headersWithCors({
headers: new Headers(),
req
}),
status: httpStatus.CREATED
});
};
//# sourceMappingURL=create.js.map