tranrecord的save方法改为调用inertOrUpdate方法
This commit is contained in:
parent
9e8d14ba84
commit
f07bdcf575
@ -8,15 +8,9 @@ class RecordController extends BaseController {
|
||||
async save(req) {
|
||||
let { _id } = req.params
|
||||
let user = req.user
|
||||
let record
|
||||
if (!_id) {
|
||||
record = new TranRecord(req.params)
|
||||
record.account = user.id
|
||||
} else {
|
||||
record = await TranRecord.findById(_id)
|
||||
record.account = user.id
|
||||
}
|
||||
await record.save()
|
||||
let data: any = req.params
|
||||
data.account = user.id
|
||||
let record = await TranRecord.insertOrUpdate({ transactionHash: req.params.transactionHash }, data)
|
||||
return record.toJson()
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user