Lambda-School-Labs/shopping-cart-be

View on GitHub
controllers/product/editProduct.js

Summary

Maintainability
A
1 hr
Test Coverage

Function editProduct has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

async function editProduct(req, res) {
    const { errors, isValid } = validateProductData(req.body);
    const productId = req.params.product_id;

    if (!isValid) {
Severity: Minor
Found in controllers/product/editProduct.js - About 1 hr to fix

    Parsing error: Invalid ecmaVersion.
    Open

    const Product = require('../../models/product');
    Severity: Minor
    Found in controllers/product/editProduct.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    There are no issues that match your filters.

    Category
    Status