Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
not throwing error in log
Browse files Browse the repository at this point in the history
  • Loading branch information
batamar committed Dec 5, 2019
1 parent 49b0912 commit efefb6a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/data/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -654,10 +654,16 @@ const putLog = (body: ILogParams, user: IUserDocument) => {
unicode: user.username || user.email || user._id,
};

return sendRequest(
{ url: `${LOGS_DOMAIN}/logs/create`, method: 'post', body: { params: JSON.stringify(doc) } },
'Failed to connect to logs api. Check whether LOGS_API_DOMAIN env is missing or logs api is not running',
);
return new Promise(resolve => {
sendRequest(
{ url: `${LOGS_DOMAIN}/logs/create`, method: 'post', body: { params: JSON.stringify(doc) } },
'Failed to connect to logs api. Check whether LOGS_API_DOMAIN env is missing or logs api is not running',
)
.then(response => console.log(response))
.catch(error => console.log(error.message));

return resolve('received log');
});
};

/**
Expand Down

0 comments on commit efefb6a

Please sign in to comment.