code | alternative code | url | expected response |
---|---|---|---|
App.store.findById(App.User, 123) |
App.User.find(123) |
https://www.example.com/myNamespace/users/123 |
{user:{ ...user123... }} |
App.store.findAll(App.User) |
App.User.find() |
https://www.example.com/myNamespace/users |
{users:[{ ...user1... },{ ...user2... },{ ...userN... }} |
App.store.findMany(App.User, [1,2,3]) |
not supported | https://www.example.com/myNamespace/users?ids[]=1&ids[]=2&ids[]=3 |
{users:[{ ...user1... },{ ...user2... },{ ...user3... }} |
App.store.findQuery(App.User, {firstName: 'Bob'}) |
App.User.find({firstName: 'Bob'}) |
https://www.example.com/myNamespace/users?firstName=Bob |
{users:[{ ...user1... },{ ...user2... },{ ...userN... }} |
Last active
December 20, 2015 18:38
-
-
Save bobjackman/6176984 to your computer and use it in GitHub Desktop.
Ember-Data Example URLs
#Get One Model
App.store.findById(App.User, 123)
or
App.User.find(123)
https://www.example.com/myNamespace/users/123
{
user: { ...user123... }
}
#Get Some Models
App.store.findMany(App.User, [1,2,3])
https://www.example.com/myNamespace/users?ids[]=1&ids[]=2&ids[]=3
{
users: [
{ ...user1... },
{ ...user2... },
{ ...user3... }
]
}
#Search for Models
App.store.findQuery(App.User, {firstName: 'Bob'})
or
App.User.find({firstName: 'Bob'})
https://www.example.com/myNamespace/users?firstName=Bob
{
users: [
{ ...user1... },
{ ...user2... },
{ ...userN... }
]
}
#Get All Models
App.store.findAll(App.User)
or
App.User.find()
https://www.example.com/myNamespace/users
{
users: [
{ ...user1... },
{ ...user2... },
{ ...userN... }
]
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment