Await for creating a DB operation

This commit is contained in:
haad 2016-03-05 12:11:50 +01:00
parent 11d98c477f
commit 8686317bf2

View File

@ -11,8 +11,8 @@ class Operation {
static create(ipfs, log, user, operation, key, value, data) {
var createOperation = async(() => {
return new Promise(async((resolve, reject) => {
const hash = Operation._createOperation(ipfs, user, operation, key, value);
const res = await(log.add(hash));
const hash = await(Operation._createOperation(ipfs, user, operation, key, value));
await(log.add(hash));
const listHash = await(log.ipfsHash);
resolve(listHash);
}));