Files
klz-cables.com/.pnpm-store/v10/files/1a/f82c66cdb7aecc53801f7b7880fa078550786a9ef25e8fdc0a4c37d11295d134bc08de687b7d8cc35fa72068d8876e9a1dae46710c85e60e9247d36dcf70b1
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

24 lines
722 B
Plaintext

import toSnakeCase from 'to-snake-case';
import { findMany } from './find/findMany.js';
export const findGlobal = async function findGlobal({ slug, locale, req, select, where }) {
const globalConfig = this.payload.globals.config.find((config)=>config.slug === slug);
const tableName = this.tableNameMap.get(toSnakeCase(globalConfig.slug));
const { docs: [doc] } = await findMany({
adapter: this,
fields: globalConfig.flattenedFields,
limit: 1,
locale,
pagination: false,
req,
select,
tableName,
where
});
if (doc) {
doc.globalType = slug;
return doc;
}
return {};
};
//# sourceMappingURL=findGlobal.js.map