Skip to content

Commit

Permalink
Order pages now uses url parameter instead of querystrings to get ord…
Browse files Browse the repository at this point in the history
…ers of different types
  • Loading branch information
sahat committed Dec 30, 2013
1 parent 654379c commit 8edd69e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ app.del('/items/:id', function(req, res) {
});
});

app.get('/orders', function(req, res) {
var orderType = req.query.type;
app.get('/orders/:type', function(req, res) {
var orderType = req.params.type;
Order.find({ orderType: orderType }, function(err, orders) {
var locations = [];
for (var i = 0; i < orders.length; i++) {
Expand Down
4 changes: 2 additions & 2 deletions views/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ block content
i.fa.fa-usd
| Sell
a.btn.btn-block.btn-success(href='/orders/new/sell') Place Order
a.btn.btn-block.btn-default(href='/orders?type=sell') View Existing Orders
a.btn.btn-block.btn-default(href='/orders/sell') View Existing Orders
.col-sm-6
.lead.text-primary.text-center
i.fa.fa-cutlery
| Create
a.btn.btn-block.btn-primary(href='/orders/new/create') Place Order
a.btn.btn-block.btn-default(href='/orders?type=create') View Existing Orders
a.btn.btn-block.btn-default(href='/orders/create') View Existing Orders
2 changes: 1 addition & 1 deletion views/placeOrder.jade
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ block content
label
input(type='radio', name='location', value='#{store}')
= store
br
hr
h4
i.fa.fa-edit
| Order Items
Expand Down

0 comments on commit 8edd69e

Please sign in to comment.