Files
klz-cables.com/.pnpm-store/v10/files/ab/8d173dc2a0ca4245fe94dd8ff907fc0275099666548a33c564ebc0539b03e00183bed9f293dae11f3a02693832df395cd6fa3aabd24a2971c5f82b4e8811ff
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

25 lines
767 B
Plaintext

import toSnakeCase from 'to-snake-case';
import { findMany } from './find/findMany.js';
export async function findOne({ collection, draftsEnabled, joins, locale, req, select, where }) {
const collectionConfig = this.payload.collections[collection].config;
const tableName = this.tableNameMap.get(toSnakeCase(collectionConfig.slug));
const { docs } = await findMany({
adapter: this,
collectionSlug: collection,
draftsEnabled,
fields: collectionConfig.flattenedFields,
joins,
limit: 1,
locale,
page: 1,
pagination: false,
req,
select,
sort: undefined,
tableName,
where
});
return docs?.[0] || null;
}
//# sourceMappingURL=findOne.js.map