{"version":3,"file":"relations.cjs","names":[],"sources":["../../../../src/rest/commands/delete/relations.ts"],"sourcesContent":["import type { DirectusRelation } from '../../../schema/relation.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Delete an existing relation.\n * @param collection\n * @param field\n * @returns\n * @throws Will throw if collection is empty\n * @throws Will throw if field is empty\n */\nexport const deleteRelation =\n\t<Schema>(\n\t\tcollection: DirectusRelation<Schema>['collection'],\n\t\tfield: DirectusRelation<Schema>['field'],\n\t): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(collection, 'Collection cannot be empty');\n\t\tthrowIfEmpty(field, 'Field cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/relations/${collection}/${field}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"kDAYa,GAEX,EACA,SAGA,EAAA,aAAa,EAAY,6BAA6B,CACtD,EAAA,aAAa,EAAO,wBAAwB,CAErC,CACN,KAAM,cAAc,EAAW,GAAG,IAClC,OAAQ,SACR"}