(data, importHash)
| 548 | } |
| 549 | |
| 550 | async import(data, importHash) { |
| 551 | if (!importHash) { |
| 552 | throw new Error400(this.options.language, 'importer.errors.importHashRequired') |
| 553 | } |
| 554 | |
| 555 | if (await this._isImportHashExistent(importHash)) { |
| 556 | throw new Error400(this.options.language, 'importer.errors.importHashExistent') |
| 557 | } |
| 558 | |
| 559 | const dataToCreate = { |
| 560 | ...data, |
| 561 | importHash, |
| 562 | } |
| 563 | |
| 564 | return this.create(dataToCreate) |
| 565 | } |
| 566 | |
| 567 | async _isImportHashExistent(importHash) { |
| 568 | const count = await TenantRepository.count( |
nothing calls this directly
no test coverage detected