Files
klz-cables.com/.pnpm-store/v10/files/5a/2390a9b5581b8f37cd8bd9dfb8b51c9327451533ebb7a3564f67c3d59c6d1fe15e3825b43cbdb7181f6300110a372328d1021ef656170ca328726e1b11121f
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.1 KiB
Plaintext

import { status as httpStatus } from 'http-status';
import { APIError } from '../../errors/APIError.js';
import { getRequestCollection } from '../../utilities/getRequestEntity.js';
import { headersWithCors } from '../../utilities/headersWithCors.js';
import { parseParams } from '../../utilities/parseParams/index.js';
import { findDistinctOperation } from '../operations/findDistinct.js';
export const findDistinctHandler = async (req)=>{
const collection = getRequestCollection(req);
const { depth, field, limit, page, sort, trash, where } = parseParams(req.query);
if (!field) {
throw new APIError('field must be specified', httpStatus.BAD_REQUEST);
}
const result = await findDistinctOperation({
collection,
depth,
field,
limit,
page,
req,
sort,
trash,
where
});
return Response.json(result, {
headers: headersWithCors({
headers: new Headers(),
req
}),
status: httpStatus.OK
});
};
//# sourceMappingURL=findDistinct.js.map