Files
klz-cables.com/.pnpm-store/v10/files/97/a4cd7155c20007dcd5aaa4856239796ac791eb82929b885071c305bb20aa9e68744523ebfbbdf3a7a8a3f8aeb1cec676740b05d87d44dd22bcca2aeaab0ab6
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.8 KiB
Plaintext

{"version":3,"file":"singleton.js","names":[],"sources":["../../../../src/rest/commands/update/singleton.ts"],"sourcesContent":["import type {\n\tApplyQueryFields,\n\tCollectionType,\n\tNestedPartial,\n\tQuery,\n\tSingletonCollections,\n} from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfCoreCollection, throwIfEmpty } from '../../utils/index.js';\n\nexport type UpdateSingletonOutput<\n\tSchema,\n\tCollection extends SingletonCollections<Schema>,\n\tTQuery extends Query<Schema, Schema[Collection]>,\n> = ApplyQueryFields<Schema, CollectionType<Schema, Collection>, TQuery['fields']>;\n\n/**\n * Update a singleton item\n *\n * @param collection The collection of the items\n * @param query The query parameters\n *\n * @returns An array of up to limit item objects. If no items are available, data will be an empty array.\n * @throws Will throw if collection is a core collection\n * @throws Will throw if collection is empty\n */\nexport const updateSingleton =\n\t<\n\t\tSchema,\n\t\tCollection extends SingletonCollections<Schema>,\n\t\tconst TQuery extends Query<Schema, Schema[Collection]>,\n\t\tItem = Schema[Collection],\n\t>(\n\t\tcollection: Collection,\n\t\titem: NestedPartial<Item>,\n\t\tquery?: TQuery,\n\t): RestCommand<UpdateSingletonOutput<Schema, Collection, TQuery>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(collection), 'Collection cannot be empty');\n\t\tthrowIfCoreCollection(collection, 'Cannot use updateSingleton for core collections');\n\n\t\treturn {\n\t\t\tpath: `/items/${collection as string}`,\n\t\t\tparams: query ?? {},\n\t\t\tbody: JSON.stringify(item),\n\t\t\tmethod: 'PATCH',\n\t\t};\n\t};\n"],"mappings":"0IA0BA,MAAa,GAOX,EACA,EACA,SAGA,EAAa,OAAO,EAAW,CAAE,6BAA6B,CAC9D,EAAsB,EAAY,kDAAkD,CAE7E,CACN,KAAM,UAAU,IAChB,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,QACR"}