fix: EventRepository.create returning undefined

This commit is contained in:
Ricardo Arturo Cabral Mejia 2022-08-07 20:00:46 +00:00
parent b5987915b1
commit 33b5f90d4c
No known key found for this signature in database
GPG Key ID: 5931EBF43A650245

View File

@ -83,17 +83,12 @@ export class EventRepository implements IEventRepository {
event_signature: pipe(prop('sig'), toBuffer),
})(event)
return void this.dbClient('events')
return this.dbClient('events')
.insert(row)
.onConflict('event_id')
.ignore()
.then(
(result) => {
return (result as any).rowCount
},
(error) => {
console.error('mistakes were made', error)
},
(({ rowCount }: { rowCount: number }) => rowCount) as any,
)
}
}