Created
August 11, 2016 17:41
-
-
Save sebyx07/2157fc7dfc41651bd0968a1597b94ed4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//store-todo.js | |
import DS from 'ember-data'; | |
export default DS.Model.extend({ | |
description: DS.attr('string'), | |
name: DS.attr('string'), | |
storeTodoStatuses: DS.hasMany('store-todo-status') | |
}); | |
//store-todo-status.js | |
import DS from 'ember-data'; | |
export default DS.Model.extend({ | |
completed: DS.attr('boolean'), | |
storeTodo: DS.belongsTo('store-todo'), | |
cStore: DS.belongsTo('store') | |
}); |
This file contains hidden or 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
{ | |
"data":[ | |
{ | |
"id":"1", | |
"type":"store-todo-statuses", | |
"links":{ | |
"self":"http://localhost:3000/api/v1/store-todo-statuses/1" | |
}, | |
"attributes":{ | |
"completed":false | |
}, | |
"relationships":{ | |
"store":{ | |
"links":{ | |
"self":"http://localhost:3000/api/v1/store-todo-statuses/1/relationships/store", | |
"related":"http://localhost:3000/api/v1/store-todo-statuses/1/store" | |
} | |
}, | |
"store-todo":{ | |
"links":{ | |
"self":"http://localhost:3000/api/v1/store-todo-statuses/1/relationships/store-todo", | |
"related":"http://localhost:3000/api/v1/store-todo-statuses/1/store-todo" | |
}, | |
"data":{ | |
"type":"store-todos", | |
"id":"1" | |
} | |
} | |
} | |
} | |
], | |
"included":[ | |
{ | |
"id":"1", | |
"type":"store-todos", | |
"links":{ | |
"self":"http://localhost:3000/api/v1/store-todos/1" | |
}, | |
"attributes":{ | |
"name":"Todo", | |
"description":"Do that" | |
}, | |
"relationships":{ | |
"store-todo-statuses":{ | |
"links":{ | |
"self":"http://localhost:3000/api/v1/store-todos/1/relationships/store-todo-statuses", | |
"related":"http://localhost:3000/api/v1/store-todos/1/store-todo-statuses" | |
} | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment