{"version":3,"file":"panels.cjs","names":[],"sources":["../../../../src/rest/commands/delete/panels.ts"],"sourcesContent":["import type { DirectusPanel } from '../../../schema/panel.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Delete multiple existing panels.\n * @param keys\n * @returns\n * @throws Will throw if keys is empty\n */\nexport const deletePanels =\n\t<Schema>(keys: DirectusPanel<Schema>['id'][]): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/panels`,\n\t\t\tbody: JSON.stringify(keys),\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n\n/**\n * Delete an existing panel.\n * @param key\n * @returns\n * @throws Will throw if key is empty\n */\nexport const deletePanel =\n\t<Schema>(key: DirectusPanel<Schema>['id']): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(key, 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/panels/${key}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"kDAUa,EACH,QAER,EAAA,aAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,UACN,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,SACR,EASU,EACH,QAER,EAAA,aAAa,EAAK,sBAAsB,CAEjC,CACN,KAAM,WAAW,IACjB,OAAQ,SACR"}