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
33 lines
997 B
Plaintext
33 lines
997 B
Plaintext
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 { findOperation } from '../operations/find.js';
|
|
export const findHandler = async (req)=>{
|
|
const collection = getRequestCollection(req);
|
|
const { depth, draft, joins, limit, page, pagination, populate, select, sort, trash, where } = parseParams(req.query);
|
|
const result = await findOperation({
|
|
collection,
|
|
depth,
|
|
draft,
|
|
joins,
|
|
limit,
|
|
page,
|
|
pagination,
|
|
populate,
|
|
req,
|
|
select,
|
|
sort,
|
|
trash,
|
|
where
|
|
});
|
|
return Response.json(result, {
|
|
headers: headersWithCors({
|
|
headers: new Headers(),
|
|
req
|
|
}),
|
|
status: httpStatus.OK
|
|
});
|
|
};
|
|
|
|
//# sourceMappingURL=find.js.map |