Files
klz-cables.com/.pnpm-store/v10/files/77/5de4f27d007f923be17a043ba995904e0c2de7736e91c9c155275fbe4f04169750469203ea591cb963f2d23182a579f51a60b3e39d801a3554438d36fe4759
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

1 line
1.9 KiB
Plaintext

{"version":3,"sources":["../src/count.ts"],"sourcesContent":["import type { Count, SanitizedCollectionConfig } from 'payload'\n\nimport toSnakeCase from 'to-snake-case'\n\nimport type { DrizzleAdapter } from './types.js'\n\nimport { buildQuery } from './queries/buildQuery.js'\nimport { getTransaction } from './utilities/getTransaction.js'\n\nexport const count: Count = async function count(\n this: DrizzleAdapter,\n { collection, locale, req, where: whereArg },\n) {\n const collectionConfig: SanitizedCollectionConfig = this.payload.collections[collection].config\n\n const tableName = this.tableNameMap.get(toSnakeCase(collectionConfig.slug))\n\n const { joins, where } = buildQuery({\n adapter: this,\n fields: collectionConfig.flattenedFields,\n locale,\n tableName,\n where: whereArg,\n })\n\n const db = await getTransaction(this, req)\n\n const countResult = await this.countDistinct({\n db,\n joins,\n tableName,\n where,\n })\n\n return { totalDocs: countResult }\n}\n"],"names":["toSnakeCase","buildQuery","getTransaction","count","collection","locale","req","where","whereArg","collectionConfig","payload","collections","config","tableName","tableNameMap","get","slug","joins","adapter","fields","flattenedFields","db","countResult","countDistinct","totalDocs"],"mappings":"AAEA,OAAOA,iBAAiB,gBAAe;AAIvC,SAASC,UAAU,QAAQ,0BAAyB;AACpD,SAASC,cAAc,QAAQ,gCAA+B;AAE9D,OAAO,MAAMC,QAAe,eAAeA,MAEzC,EAAEC,UAAU,EAAEC,MAAM,EAAEC,GAAG,EAAEC,OAAOC,QAAQ,EAAE;IAE5C,MAAMC,mBAA8C,IAAI,CAACC,OAAO,CAACC,WAAW,CAACP,WAAW,CAACQ,MAAM;IAE/F,MAAMC,YAAY,IAAI,CAACC,YAAY,CAACC,GAAG,CAACf,YAAYS,iBAAiBO,IAAI;IAEzE,MAAM,EAAEC,KAAK,EAAEV,KAAK,EAAE,GAAGN,WAAW;QAClCiB,SAAS,IAAI;QACbC,QAAQV,iBAAiBW,eAAe;QACxCf;QACAQ;QACAN,OAAOC;IACT;IAEA,MAAMa,KAAK,MAAMnB,eAAe,IAAI,EAAEI;IAEtC,MAAMgB,cAAc,MAAM,IAAI,CAACC,aAAa,CAAC;QAC3CF;QACAJ;QACAJ;QACAN;IACF;IAEA,OAAO;QAAEiB,WAAWF;IAAY;AAClC,EAAC"}