Skip to content

Commit

Permalink
new orders listing support
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Mar 20, 2016
1 parent b4aa667 commit 64f0ca8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/budy/controllers/api/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,23 @@ def me(self):
account = budy.BudyAccount.from_session(map = True)
return account

@appier.route("/api/accounts/me/orders", "GET", json = True)
@appier.ensure(token = "user")
def orders_me(self):
account = budy.BudyAccount.from_session()
orders = budy.Order.find(
account = account.id,
paid = True,
eager = (
"lines",
"lines.product",
"shipping_address",
"billing_address"
),
map = True
)
return orders

@appier.route("/api/accounts/me/addresses", "GET", json = True)
@appier.ensure(token = "user")
def addresses_me(self):
Expand Down

0 comments on commit 64f0ca8

Please sign in to comment.