Skip to content

Commit

Permalink
removed logs
Browse files Browse the repository at this point in the history
  • Loading branch information
amituuush committed May 14, 2018
1 parent 68f624b commit c03406e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 24 deletions.
6 changes: 3 additions & 3 deletions app/methods/create.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var Orders = require('../models/orders');

var create = function(order, callback) {
Orders.create(order, function(err, result) {
var create = function (order, callback) {
Orders.create(order, function (err, result) {
if (err || !order) {
console.error("Could not create order", order);
console.log(err);
console.log('err', err);
return;
}
callback(null, result);
Expand Down
2 changes: 0 additions & 2 deletions customer/api.es6
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ module.exports = {

service.nearbySearch(request, function (results, status) {
if (status == google.maps.places.PlacesServiceStatus.OK) {
console.log('results', results);
console.log('shops', results);
callback(results);
}
});
Expand Down
1 change: 0 additions & 1 deletion customer/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ var App = React.createClass({
// --------------USER LOCATION AND GOOGLE MAPS API CALL--------------

_handleUserLocation: function (position) {
console.log('position', position);
this.setState({
userLocation: {
lat: position.coords.latitude,
Expand Down
3 changes: 0 additions & 3 deletions public/customer-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25897,7 +25897,6 @@
// --------------USER LOCATION AND GOOGLE MAPS API CALL--------------

_handleUserLocation: function _handleUserLocation(position) {
console.log('position', position);
this.setState({
userLocation: {
lat: position.coords.latitude,
Expand Down Expand Up @@ -43200,8 +43199,6 @@

service.nearbySearch(request, function (results, status) {
if (status == google.maps.places.PlacesServiceStatus.OK) {
console.log('results', results);
console.log('shops', results);
callback(results);
}
});
Expand Down
14 changes: 6 additions & 8 deletions routers/getPrevsAndFavs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@ var app = express();
var read = require('../app/methods/read');


app.get('/users/:username/orders/previous', function(req, res) {
console.log(req.params);
read({username: req.params.username}, function(err, listOfOrders) {
app.get('/users/:username/orders/previous', function (req, res) {
read({ username: req.params.username }, function (err, listOfOrders) {
res.json(listOfOrders);
res.status(200);
})
})

app.get('/users/:username/orders/favorites', function(req, res) {
console.log(req.params);
app.get('/users/:username/orders/favorites', function (req, res) {
read({
favorited: true,
username: req.params.username
}, function(err, listOfOrders) {
res.json(listOfOrders);
res.status(200);
}, function (err, listOfOrders) {
res.json(listOfOrders);
res.status(200);
})
})

Expand Down
13 changes: 6 additions & 7 deletions routers/orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ var jsonParser = bodyParser.json();
var create = require('../app/methods/create');
var read = require('../app/methods/read');

app.get('/orders', jsonParser, function(req,res) {
read({}, function(err, listOfOrders) {
app.get('/orders', jsonParser, function (req, res) {
read({}, function (err, listOfOrders) {
if (err) {
res.json(err)
}
Expand All @@ -16,16 +16,15 @@ app.get('/orders', jsonParser, function(req,res) {
})
})

app.post('/orders', jsonParser, function(req, res) {
create(req.body, function(err, order) {
app.post('/orders', jsonParser, function (req, res) {
create(req.body, function (err, order) {
res.json(order);
res.status(201);
});
})

app.delete('/orders', jsonParser, function(req, res) {
Orders.remove({}, function(err) {
console.log('collection removed');
app.delete('/orders', jsonParser, function (req, res) {
Orders.remove({}, function (err) {
res.json('collection removed')
res.status(200);
});
Expand Down

0 comments on commit c03406e

Please sign in to comment.