Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
dfdf
import DS from "ember-data";
export default DS.RESTAdapter.extend({
host: 'http://localhost:4101/api/v1',
buildURL: function(root, suffix, record) {
var url = this._super();
return url + '/posts/' + suffix + '/versions';
}
});
import DS from 'ember-data';
export default DS.Model.extend({
post_id: DS.attr('number'),
version: DS.attr('number'),
test: DS.attr('string')
});
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
var PostsRoute = Ember.Route.extend({
model: function(params) {
var _this = this;
var posts = _this.store.find('post');
posts.then(
function(postList) {
var mostRecentPost = postList.get('lastObject');
var recentPostInfo = _this.store.find('post-version', mostRecentPost.get('id'));
},
function(resolve) { }
);
}
});
export default PostsRoute.extend(AuthenticatedRouteMixin);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment