mirror of
https://github.com/directus/directus.git
synced 2026-01-24 10:08:06 -05:00
@@ -260,6 +260,12 @@ export class CollectionsService {
|
||||
throw new ForbiddenException('Only admins can perform this action.');
|
||||
}
|
||||
|
||||
const collectionItemsService = new ItemsService('directus_collections', {
|
||||
knex: this.knex,
|
||||
accountability: this.accountability,
|
||||
schema: this.schema,
|
||||
});
|
||||
|
||||
const fieldsService = new FieldsService({
|
||||
knex: this.knex,
|
||||
accountability: this.accountability,
|
||||
@@ -276,6 +282,8 @@ export class CollectionsService {
|
||||
}
|
||||
}
|
||||
|
||||
await collectionItemsService.delete(collectionKeys);
|
||||
|
||||
await this.knex('directus_fields').delete().whereIn('collection', collectionKeys);
|
||||
await this.knex('directus_presets').delete().whereIn('collection', collectionKeys);
|
||||
await this.knex('directus_revisions').delete().whereIn('collection', collectionKeys);
|
||||
@@ -305,14 +313,6 @@ export class CollectionsService {
|
||||
}
|
||||
}
|
||||
|
||||
const collectionItemsService = new ItemsService('directus_collections', {
|
||||
knex: this.knex,
|
||||
accountability: this.accountability,
|
||||
schema: this.schema,
|
||||
});
|
||||
|
||||
await collectionItemsService.delete(collectionKeys);
|
||||
|
||||
for (const collectionKey of collectionKeys) {
|
||||
await this.knex.schema.dropTable(collectionKey);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user