Fixed purchase history

This commit is contained in:
Eduard Urbach 2017-10-06 20:03:24 +02:00
parent 42320917f8
commit b250f2ea7e

View File

@ -18,7 +18,9 @@ func PurchaseHistory(ctx *aero.Context) string {
return ctx.Error(http.StatusUnauthorized, "Not logged in", nil)
}
purchases, err := arn.AllPurchases()
purchases, err := arn.FilterPurchases(func(purchase *arn.Purchase) bool {
return purchase.UserID == user.ID
})
if err != nil {
return ctx.Error(http.StatusInternalServerError, "Error fetching shop item data", err)