• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

atlp-rwanda / trojans-ec-bn / 2afd455b-0aa8-4157-bcd6-7b8d240a9895

pending completion
2afd455b-0aa8-4157-bcd6-7b8d240a9895

Pull #111

circleci

teerenzo
payment
Pull Request #111: #184347109 Buyer should be able to make a payment

375 of 447 branches covered (83.89%)

Branch coverage included in aggregate %.

65 of 65 new or added lines in 9 files covered. (100.0%)

862 of 949 relevant lines covered (90.83%)

14.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/src/middlewares/checkUserCartExist.js
1
/* eslint-disable require-jsdoc */
2
import { Cart } from "../database/models/index";
3

4
export default async function IsUserHasCart(req, res, next) {
5
  try {
2✔
6
    const userId = req.user.id
2✔
7
    const cart = await Cart.findOne({ where: { buyerId: userId } });
2✔
8
    if (!cart) {
2!
9
      return res
×
10
        .status(404)
11
        .json({ status: 404, message: "add product(s) to cart first" });
12
    }
13
    next();
2✔
14
  } catch (error) {
15
    return res.status(500).json({ status: 500, error: "server error" });
×
16
  }
17
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc