type(rpc): add missing

This commit is contained in:
georgelima 2019-02-04 22:30:46 -02:00
parent 670145753a
commit d0191ca7d6
1 changed files with 2 additions and 3 deletions

View File

@ -20,6 +20,7 @@ const client = got.extend({
auth: `${RPC.user}:${RPC.password}`,
});
// $FlowFixMe
const api: APIMethods = METHODS.reduce(
(obj, method) => ({
...obj,
@ -33,9 +34,7 @@ const api: APIMethods = METHODS.reduce(
},
})
.then(data => Promise.resolve(data.body && data.body.result))
.catch(payload => Promise.reject(
new Error(payload.body?.error.message || 'Something went wrong'),
)),
.catch(payload => Promise.reject(new Error(payload.body?.error.message || 'Something went wrong'))),
}),
{},
);