Skip to content

Commit

Permalink
[feature] Cleanup code and remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Easybuoy committed Oct 19, 2018
1 parent 8e0349d commit 32cfca8
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 25 deletions.
1 change: 0 additions & 1 deletion server/routes/api/v1/products.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const upload = multer(
},
);

// const upload = multer({ dest: 'uploads/products/' });
const router = express.Router();

// @route GET api/v1/products
Expand Down
1 change: 0 additions & 1 deletion server/routes/api/v1/sales.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ router.post('/', passport.authenticate('jwt', { session: false }), (req, res) =>
let isNotProductAvailable = false;
let totalSalesAmount = 0;
order.map((ordertobeprocessed) => {
// console.log(order);
const { quantity } = ordertobeprocessed;
const productId = ordertobeprocessed.product_id;

Expand Down
1 change: 0 additions & 1 deletion server/routes/api/v1/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ router.post('/login', (req, res) => {
bcrypt.compare(password, userData.password)
.then((isMatch) => {
if (isMatch) {
// res.json({ msg: 'Success' });
// User Matched
const payload = {
id: userData.id,
Expand Down
13 changes: 0 additions & 13 deletions server/test/salesTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,6 @@ describe('Get A Sale Record', () => {
});

describe('Create New Sale Record', () => {
// it('create a new sale', (done) => {
// chai.request(app).post('/api/v1/sales')
// .send({
// store_attendant_user_id: '1', product_id: '2',
// })
// .end((err, res) => {
// expect(res).to.have.status(201);
// expect(res.body.message).to.equal('Sale added successfully');

// done();
// });
// });

it('create a new sale', (done) => {
chai.request(app).post('/api/v1/users/login')
.send({
Expand Down
9 changes: 0 additions & 9 deletions server/validation/sales.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// import Validator from 'validator';
import isEmpty from './isEmpty';

const validateSalesInput = (input) => {
Expand All @@ -7,14 +6,6 @@ const validateSalesInput = (input) => {
data.quantity = !isEmpty(data.quantity) ? data.quantity : '';
data.product_id = !isEmpty(data.product_id) ? data.product_id : '';

// if (Validator.isEmpty(data.quantity)) {
// errors.quantity = 'Quantity field is required';
// }

// if (Validator.isEmpty(data.product_id)) {
// errors.product_id = 'Product Id field is required';
// }

if (!Array.isArray(data.order)) {
errors.order = 'Order must be an array of object(s)';
}
Expand Down

0 comments on commit 32cfca8

Please sign in to comment.