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