Files
klz-cables.com/.pnpm-store/v10/files/ff/9a7bf5c04ba2fc64cdeae0a4358adfdaba3f9f0237962eafaaeaa438c7f434d2f7cec23b1253cc04301a259351788d4b93cbcd491905e5c29ed72990fbbbf2
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.1 KiB
Plaintext

{"version":3,"file":"collections.cjs","names":[],"sources":["../../../../src/rest/commands/update/collections.ts"],"sourcesContent":["import type { DirectusCollection } from '../../../schema/collection.js';\nimport type { ApplyQueryFields, NestedPartial, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport type UpdateCollectionOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusCollection<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * Update the metadata for an existing collection.\n * @param collection\n * @param item\n * @param query\n * @returns The collection object for the updated collection in this request.\n * @throws Will throw if collection is empty\n */\nexport const updateCollection =\n\t<Schema, const TQuery extends Query<Schema, DirectusCollection<Schema>>>(\n\t\tcollection: DirectusCollection<Schema>['collection'],\n\t\titem: NestedPartial<DirectusCollection<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<UpdateCollectionOutput<Schema, TQuery>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(collection, 'Collection cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/collections/${collection}`,\n\t\t\tparams: query ?? {},\n\t\t\tbody: JSON.stringify(item),\n\t\t\tmethod: 'PATCH',\n\t\t};\n\t};\n\n/**\n * Update multiple collections as batch.\n * @param items\n * @param query\n * @returns Returns the collection objects for the updated collections.\n */\nexport const updateCollectionsBatch =\n\t<Schema, const TQuery extends Query<Schema, DirectusCollection<Schema>>>(\n\t\titems: NestedPartial<DirectusCollection<Schema>>[],\n\t\tquery?: TQuery,\n\t): RestCommand<UpdateCollectionOutput<Schema, TQuery>, Schema> =>\n\t() => ({\n\t\tpath: `/collections`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(items),\n\t\tmethod: 'PATCH',\n\t});\n"],"mappings":"kDAmBa,GAEX,EACA,EACA,SAGA,EAAA,aAAa,EAAY,6BAA6B,CAE/C,CACN,KAAM,gBAAgB,IACtB,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,QACR,EASU,GAEX,EACA,SAEM,CACN,KAAM,eACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAM,CAC3B,OAAQ,QACR"}