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
1 line
1.0 KiB
Plaintext
1 line
1.0 KiB
Plaintext
{"version":3,"file":"fields.js","names":[],"sources":["../../../../src/rest/commands/delete/fields.ts"],"sourcesContent":["import type { DirectusField } from '../../../schema/field.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Deletes the given field in the given collection.\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 deleteField =\n\t<Schema>(\n\t\tcollection: DirectusField<Schema>['collection'],\n\t\tfield: DirectusField<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: `/fields/${collection}/${field}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"6DAYA,MAAa,GAEX,EACA,SAGA,EAAa,EAAY,6BAA6B,CACtD,EAAa,EAAO,wBAAwB,CAErC,CACN,KAAM,WAAW,EAAW,GAAG,IAC/B,OAAQ,SACR"} |