Files
klz-cables.com/.pnpm-store/v10/files/59/9bdd7d70dd338f19f9bf49563f6ce128b675c9e0fa29872a5e2d82ea12c3e2cc1379d768aae2e0a6c57a83576e6c6171f1a9de055fd0daaaaa0fcd27d669d7
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":"policies.js","names":[],"sources":["../../../../src/rest/commands/update/policies.ts"],"sourcesContent":["import type { DirectusPolicy } from '../../../schema/policy.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 UpdatePolicyOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusPolicy<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * Update multiple existing policies.\n * @param keys\n * @param item\n * @param query\n * @returns Returns the policies objects for the updated policies.\n * @throws Will throw if keys is empty\n */\nexport const updatePolicies =\n\t<Schema, const TQuery extends Query<Schema, DirectusPolicy<Schema>>>(\n\t\tkeys: DirectusPolicy<Schema>['id'][],\n\t\titem: NestedPartial<DirectusPolicy<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<UpdatePolicyOutput<Schema, TQuery>[], Schema> =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/policies`,\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 policies as batch.\n * @param items\n * @param query\n * @returns Returns the policies object for the updated policies.\n */\nexport const updatePoliciesBatch =\n\t<Schema, const TQuery extends Query<Schema, DirectusPolicy<Schema>>>(\n\t\titems: NestedPartial<DirectusPolicy<Schema>>[],\n\t\tquery?: TQuery,\n\t): RestCommand<UpdatePolicyOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/policies`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(items),\n\t\tmethod: 'PATCH',\n\t});\n\n/**\n * Update an existing policy.\n * @param key\n * @param item\n * @param query\n * @returns Returns the policy object for the updated policy.\n * @throws Will throw if key is empty\n */\nexport const updatePolicy =\n\t<Schema, const TQuery extends Query<Schema, DirectusPolicy<Schema>>>(\n\t\tkey: DirectusPolicy<Schema>['id'],\n\t\titem: NestedPartial<DirectusPolicy<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<UpdatePolicyOutput<Schema, TQuery>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(key), 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/policies/${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":"6DAmBA,MAAa,GAEX,EACA,EACA,SAGA,EAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,YACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,CAAE,OAAM,KAAM,EAAM,CAAC,CAC1C,OAAQ,QACR,EASU,GAEX,EACA,SAEM,CACN,KAAM,YACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAM,CAC3B,OAAQ,QACR,EAUW,GAEX,EACA,EACA,SAGA,EAAa,OAAO,EAAI,CAAE,sBAAsB,CAEzC,CACN,KAAM,aAAa,IACnB,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,QACR"}