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

33 lines
1.4 KiB
Plaintext

import { status as httpStatus } from 'http-status';
import { getRequestGlobal } from '../../utilities/getRequestEntity.js';
import { headersWithCors } from '../../utilities/headersWithCors.js';
import { isNumber } from '../../utilities/isNumber.js';
import { sanitizePopulateParam } from '../../utilities/sanitizePopulateParam.js';
import { sanitizeSelectParam } from '../../utilities/sanitizeSelectParam.js';
import { sanitizeSortParams } from '../../utilities/sanitizeSortParams.js';
import { findVersionsOperation } from '../operations/findVersions.js';
export const findVersionsHandler = async (req)=>{
const globalConfig = getRequestGlobal(req);
const { depth, limit, page, pagination, populate, select, sort, where } = req.query;
const result = await findVersionsOperation({
depth: isNumber(depth) ? Number(depth) : undefined,
globalConfig,
limit: isNumber(limit) ? Number(limit) : undefined,
page: isNumber(page) ? Number(page) : undefined,
pagination: pagination === 'false' ? false : undefined,
populate: sanitizePopulateParam(populate),
req,
select: sanitizeSelectParam(select),
sort: sanitizeSortParams(sort),
where
});
return Response.json(result, {
headers: headersWithCors({
headers: new Headers(),
req
}),
status: httpStatus.OK
});
};
//# sourceMappingURL=findVersions.js.map