(data, importHash)
| 770 | } |
| 771 | |
| 772 | async import(data, importHash) { |
| 773 | if (!importHash) { |
| 774 | throw new Error400(this.options.language, 'importer.errors.importHashRequired') |
| 775 | } |
| 776 | |
| 777 | if (await this._isImportHashExistent(importHash)) { |
| 778 | throw new Error400(this.options.language, 'importer.errors.importHashExistent') |
| 779 | } |
| 780 | |
| 781 | const dataToCreate = { |
| 782 | ...data, |
| 783 | importHash, |
| 784 | } |
| 785 | |
| 786 | return this.upsert(dataToCreate) |
| 787 | } |
| 788 | |
| 789 | async _isImportHashExistent(importHash) { |
| 790 | const count = await ActivityRepository.count( |
nothing calls this directly
no test coverage detected