fix: remove encrypt method
This commit is contained in:
@@ -8,8 +8,6 @@ import IUser from '@/models/IUser'
|
||||
import IAccount from '@/models/IAccount'
|
||||
import IEncryptable from '@/models/IEncryptable'
|
||||
import IEncrypted from '@/models/IEncrypted'
|
||||
import { getCurrentPosition } from '@/utils'
|
||||
import mapService from './MapService'
|
||||
|
||||
class TransactionService {
|
||||
public async getNew(
|
||||
@@ -64,7 +62,6 @@ class TransactionService {
|
||||
try {
|
||||
transaction._id = couchService.newId(`tra-${accountId}`)
|
||||
transaction.doctype = 'transaction'
|
||||
transaction = await this.encrypt(transaction)
|
||||
return await couchService.save(transaction)
|
||||
} catch (error) {
|
||||
// tslint:disable-next-line:no-console
|
||||
@@ -155,20 +152,6 @@ class TransactionService {
|
||||
}
|
||||
}
|
||||
|
||||
private async encrypt(transaction: ITransaction): Promise<ITransaction> {
|
||||
if (!transaction) {
|
||||
return transaction
|
||||
}
|
||||
const encrypt = await couchService.encrypt(
|
||||
transaction.accountId || '',
|
||||
this.toEncrypt(transaction)
|
||||
)
|
||||
return {
|
||||
...transaction,
|
||||
...encrypt
|
||||
}
|
||||
}
|
||||
|
||||
private async decrypt(transaction: ITransaction): Promise<ITransaction> {
|
||||
if (!transaction) {
|
||||
return transaction
|
||||
|
||||
Reference in New Issue
Block a user