Last active
October 11, 2018 13:30
-
-
Save jneurock/b1167b777c238f5f1fd6ac7e5c597705 to your computer and use it in GitHub Desktop.
Ember Data Cart Items Example Expanded
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Route from '@ember/routing/route'; | |
import { hash } from 'rsvp'; | |
export default Route.extend({ | |
async model(params) { | |
let [cart] = await this.store.query('cart'); | |
let cartItems = this.store.query('cart-item', { | |
filter: { cartId: cart.id }, | |
include: 'address', | |
page: { | |
number: params.page, | |
size: params.pageSize | |
}, | |
sort: params.sort | |
}); | |
return hash({ cart, cartItems }); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment