Files
klz-cables.com/.pnpm-store/v10/files/45/a48dd583ea8114319775ba39e4d4702bb9f7ce4878176681d9b6d771a4ac410095b4d0255fc2b17440608942d7a61fa03ec2a225b4b6c71fe7c3e93e65aa3a
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
2.6 KiB
Plaintext

{"version":3,"sources":["../src/queryDrafts.ts"],"sourcesContent":["import type { QueryDrafts, SanitizedCollectionConfig } from 'payload'\n\nimport { buildVersionCollectionFields, combineQueries } from 'payload'\nimport toSnakeCase from 'to-snake-case'\n\nimport type { DrizzleAdapter } from './types.js'\n\nimport { findMany } from './find/findMany.js'\n\nexport const queryDrafts: QueryDrafts = async function queryDrafts(\n this: DrizzleAdapter,\n { collection, joins, limit, locale, page = 1, pagination, req, select, sort, where },\n) {\n const collectionConfig: SanitizedCollectionConfig = this.payload.collections[collection].config\n const tableName = this.tableNameMap.get(\n `_${toSnakeCase(collectionConfig.slug)}${this.versionsSuffix}`,\n )\n const fields = buildVersionCollectionFields(this.payload.config, collectionConfig, true)\n\n const combinedWhere = combineQueries({ latest: { equals: true } }, where)\n\n const result = await findMany({\n adapter: this,\n collectionSlug: collection,\n fields,\n joins,\n limit,\n locale,\n page,\n pagination,\n req,\n select,\n sort,\n tableName,\n versions: true,\n where: combinedWhere,\n })\n\n return {\n ...result,\n docs: result.docs.map((doc) => {\n doc = {\n id: doc.parent,\n ...doc.version,\n }\n\n return doc\n }),\n }\n}\n"],"names":["buildVersionCollectionFields","combineQueries","toSnakeCase","findMany","queryDrafts","collection","joins","limit","locale","page","pagination","req","select","sort","where","collectionConfig","payload","collections","config","tableName","tableNameMap","get","slug","versionsSuffix","fields","combinedWhere","latest","equals","result","adapter","collectionSlug","versions","docs","map","doc","id","parent","version"],"mappings":"AAEA,SAASA,4BAA4B,EAAEC,cAAc,QAAQ,UAAS;AACtE,OAAOC,iBAAiB,gBAAe;AAIvC,SAASC,QAAQ,QAAQ,qBAAoB;AAE7C,OAAO,MAAMC,cAA2B,eAAeA,YAErD,EAAEC,UAAU,EAAEC,KAAK,EAAEC,KAAK,EAAEC,MAAM,EAAEC,OAAO,CAAC,EAAEC,UAAU,EAAEC,GAAG,EAAEC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE;IAEpF,MAAMC,mBAA8C,IAAI,CAACC,OAAO,CAACC,WAAW,CAACZ,WAAW,CAACa,MAAM;IAC/F,MAAMC,YAAY,IAAI,CAACC,YAAY,CAACC,GAAG,CACrC,CAAC,CAAC,EAAEnB,YAAYa,iBAAiBO,IAAI,IAAI,IAAI,CAACC,cAAc,EAAE;IAEhE,MAAMC,SAASxB,6BAA6B,IAAI,CAACgB,OAAO,CAACE,MAAM,EAAEH,kBAAkB;IAEnF,MAAMU,gBAAgBxB,eAAe;QAAEyB,QAAQ;YAAEC,QAAQ;QAAK;IAAE,GAAGb;IAEnE,MAAMc,SAAS,MAAMzB,SAAS;QAC5B0B,SAAS,IAAI;QACbC,gBAAgBzB;QAChBmB;QACAlB;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAM;QACAY,UAAU;QACVjB,OAAOW;IACT;IAEA,OAAO;QACL,GAAGG,MAAM;QACTI,MAAMJ,OAAOI,IAAI,CAACC,GAAG,CAAC,CAACC;YACrBA,MAAM;gBACJC,IAAID,IAAIE,MAAM;gBACd,GAAGF,IAAIG,OAAO;YAChB;YAEA,OAAOH;QACT;IACF;AACF,EAAC"}