Files
klz-cables.com/.pnpm-store/v10/files/49/10acc352033efee13238a7a00de21179f791a4fdc1a773d7d4fc1e75e6844bc25b290c28b034aaf9077d49ad846da4dad67ba0ad68dc9a227575c73add3730
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
914 B
Plaintext

import { buildVersionGlobalFields } from 'payload';
import toSnakeCase from 'to-snake-case';
import { findMany } from './find/findMany.js';
export const findGlobalVersions = async function findGlobalVersions({ global, limit, locale, page, pagination, req, select, sort: sortArg, where }) {
const globalConfig = this.payload.globals.config.find(({ slug })=>slug === global);
const sort = sortArg !== undefined && sortArg !== null ? sortArg : '-createdAt';
const tableName = this.tableNameMap.get(`_${toSnakeCase(globalConfig.slug)}${this.versionsSuffix}`);
const fields = buildVersionGlobalFields(this.payload.config, globalConfig, true);
return findMany({
adapter: this,
fields,
limit,
locale,
page,
pagination,
req,
select,
sort,
tableName,
where
});
};
//# sourceMappingURL=findGlobalVersions.js.map