{"version":3,"file":"translations.js","names":[],"sources":["../../../../src/rest/commands/delete/translations.ts"],"sourcesContent":["import type { DirectusTranslation } from '../../../schema/translation.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Delete multiple existing translations.\n * @param keys\n * @returns\n * @throws Will throw if keys is empty\n */\nexport const deleteTranslations =\n\t(keys: DirectusTranslation['id'][]): RestCommand =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/translations`,\n\t\t\tbody: JSON.stringify(keys),\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n\n/**\n * Delete an existing translation.\n * @param key\n * @returns\n * @throws Will throw if key is empty\n */\nexport const deleteTranslation =\n\t(key: DirectusTranslation['id']): RestCommand =>\n\t() => {\n\t\tthrowIfEmpty(String(key), 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/translations/${key}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"6DAUA,MAAa,EACH,QAER,EAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,gBACN,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,SACR,EASU,EACH,QAER,EAAa,OAAO,EAAI,CAAE,sBAAsB,CAEzC,CACN,KAAM,iBAAiB,IACvB,OAAQ,SACR"}