MCPcopy Create free account
hub / github.com/linuxfoundation/crowd.dev / import

Method import

backend/src/services/activityService.ts:772–787  ·  view source on GitHub ↗
(data, importHash)

Source from the content-addressed store, hash-verified

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(

Callers

nothing calls this directly

Calls 2

_isImportHashExistentMethod · 0.95
upsertMethod · 0.95

Tested by

no test coverage detected