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

{"version":3,"file":"presets.cjs","names":[],"sources":["../../../../src/rest/commands/update/presets.ts"],"sourcesContent":["import type { DirectusPreset } from '../../../schema/preset.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 UpdatePresetOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusPreset<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * Update multiple existing presets.\n * @param keys\n * @param item\n * @param query\n * @returns Returns the preset objects for the updated presets.\n * @throws Will throw if keys is empty\n */\nexport const updatePresets =\n\t<Schema, const TQuery extends Query<Schema, DirectusPreset<Schema>>>(\n\t\tkeys: DirectusPreset<Schema>['id'][],\n\t\titem: NestedPartial<DirectusPreset<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<UpdatePresetOutput<Schema, TQuery>[], Schema> =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/presets`,\n\t\t\tparams: query ?? {},\n\t\t\tbody: JSON.stringify({ keys, data: item }),\n\t\t\tmethod: 'PATCH',\n\t\t};\n\t};\n\n/**\n * Update multiple presets as batch.\n * @param items\n * @param query\n * @returns Returns the preset objects for the updated presets.\n */\nexport const updatePresetsBatch =\n\t<Schema, const TQuery extends Query<Schema, DirectusPreset<Schema>>>(\n\t\titems: NestedPartial<DirectusPreset<Schema>>[],\n\t\tquery?: TQuery,\n\t): RestCommand<UpdatePresetOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/presets`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(items),\n\t\tmethod: 'PATCH',\n\t});\n\n/**\n * Update an existing preset.\n * @param key\n * @param item\n * @param query\n * @returns Returns the preset object for the updated preset.\n * @throws Will throw if key is empty\n */\nexport const updatePreset =\n\t<Schema, const TQuery extends Query<Schema, DirectusPreset<Schema>>>(\n\t\tkey: DirectusPreset<Schema>['id'],\n\t\titem: NestedPartial<DirectusPreset<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<UpdatePresetOutput<Schema, TQuery>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(key), 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/presets/${key}`,\n\t\t\tparams: query ?? {},\n\t\t\tbody: JSON.stringify(item),\n\t\t\tmethod: 'PATCH',\n\t\t};\n\t};\n"],"mappings":"kDAmBa,GAEX,EACA,EACA,SAGA,EAAA,aAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,WACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,CAAE,OAAM,KAAM,EAAM,CAAC,CAC1C,OAAQ,QACR,EASU,GAEX,EACA,SAEM,CACN,KAAM,WACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAM,CAC3B,OAAQ,QACR,EAUW,GAEX,EACA,EACA,SAGA,EAAA,aAAa,OAAO,EAAI,CAAE,sBAAsB,CAEzC,CACN,KAAM,YAAY,IAClB,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,QACR"}