Skip to content

Commit

Permalink
killing bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulloooh committed Mar 21, 2021
1 parent 663be4f commit f068457
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
24 changes: 13 additions & 11 deletions controllers/adController.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,21 @@ async function failEmail({ user, resp }) {
resp && resp.code
? ` <div>
<p>
An Advert placed just failed, possible cause: $
{resp.code === "1002"
? "Error Sending SMS"
: resp.code === "1003"
? "Insufficient Balance on our SmartSMS account"
: resp.code === "1005"
? "SmartSMS temporarily down"
: resp.code === "1008"
? "Unregistered Sender ID"
: resp.comment}
An Advert placed just failed, possible cause:
${
resp.code === "1002"
? "Error Sending SMS"
: resp.code === "1003"
? "Insufficient Balance on our SmartSMS account"
: resp.code === "1005"
? "SmartSMS temporarily down"
: resp.code === "1008"
? "Unregistered Sender ID"
: resp.comment
}
</p>
<p>Ad initialized by user "${user.username}"</p>
<p>Full raw details : ${JSON.stringify(resp)}</p>{" "}
<p>Full raw details : ${JSON.stringify(resp)}</p>
</div>
`
: resp && resp.scheduled
Expand Down
1 change: 1 addition & 0 deletions routes/ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ router.post("/sendsms", async (req, res) => {
await Ad.findByIdAndUpdate(start._id, {
sent_qty: expected_qty - totalFailed,
charged_cost,
refund,
wallet_before,
wallet_after: wallet_before - charged_cost,
status: "COMPLETED",
Expand Down

0 comments on commit f068457

Please sign in to comment.