Files
klz-cables.com/.pnpm-store/v10/files/8c/3c7cb28b8331fb2bb2982cdc9bf6a19afd637436a571bf3bda5b4769cae124dc4b58cb51250b3ceb70d1ed4e4fc2df60e7e1fb57fd187a169b14343abdf234
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.0 KiB
Plaintext

{"version":3,"file":"fields.js","names":[],"sources":["../../../../src/rest/commands/read/fields.ts"],"sourcesContent":["import type { DirectusField } from '../../../schema/field.js';\nimport type { ApplyQueryFields } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport type ReadFieldOutput<Schema, Item extends object = DirectusField<Schema>> = ApplyQueryFields<Schema, Item, '*'>;\n\n/**\n * List the available fields.\n * @param query The query parameters\n * @returns An array of field objects.\n */\nexport const readFields =\n\t<Schema>(): RestCommand<ReadFieldOutput<Schema>[], Schema> =>\n\t() => ({\n\t\tpath: `/fields`,\n\t\tmethod: 'GET',\n\t});\n\n/**\n * List the available fields in a given collection.\n * @param collection The primary key of the field\n * @returns\n * @throws Will throw if collection is empty\n */\nexport const readFieldsByCollection =\n\t<Schema>(collection: DirectusField<Schema>['collection']): RestCommand<ReadFieldOutput<Schema>[], Schema> =>\n\t() => {\n\t\tthrowIfEmpty(collection, 'Collection cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/fields/${collection}`,\n\t\t\tmethod: 'GET',\n\t\t};\n\t};\n\n/**\n *\n * @param key The primary key of the dashboard\n * @param query The query parameters\n * @returns\n * @throws Will throw if collection is empty\n * @throws Will throw if field is empty\n */\nexport const readField =\n\t<Schema>(\n\t\tcollection: DirectusField<Schema>['collection'],\n\t\tfield: DirectusField<Schema>['field'],\n\t): RestCommand<ReadFieldOutput<Schema>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(collection, 'Collection cannot be empty');\n\t\tthrowIfEmpty(field, 'Field cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/fields/${collection}/${field}`,\n\t\t\tmethod: 'GET',\n\t\t};\n\t};\n"],"mappings":"6DAYA,MAAa,WAEL,CACN,KAAM,UACN,OAAQ,MACR,EAQW,EACH,QAER,EAAa,EAAY,6BAA6B,CAE/C,CACN,KAAM,WAAW,IACjB,OAAQ,MACR,EAWU,GAEX,EACA,SAGA,EAAa,EAAY,6BAA6B,CACtD,EAAa,EAAO,wBAAwB,CAErC,CACN,KAAM,WAAW,EAAW,GAAG,IAC/B,OAAQ,MACR"}