-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathroute-new.js
95 lines (73 loc) · 1.93 KB
/
route-new.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import Ember from 'ember';
import Post from 'my-app/models/post';
export default Ember.Route.extend({
model: function() {
return this.store.createRecord('post', {
title: 'DHHHHHHHHHHHH'
});
},
afterModel: function(model) {
return this.store.find('post');
},
actions: {
findOne: function(){
return this.store.findById('post', '1');
},
findQuery: function(){
return this.store.findQuery('post', {foo: 'bar'})
},
findSerializer: function(){
return this.store.serializerFor('post');
},
findMetaForType: function(){
return this.store.metaForType('post');
},
pushMany: function(){
return this.store.pushMany('post', []);
},
update: function(){
return this.store.update('post', {id: '1'});
},
normalize: function(){
return this.store.normalize('post', {});
},
pushPayload: function(){
return this.store.pushPayload('post', {});
},
push: function(){
return this.store.push('post', {});
},
modelFactoryFor: function(){
return this.store.modelFactoryFor('post');
},
modelFor: function(){
return this.store.modelFor('post');
},
setMetaDataFor: function(){
return this.store.setMetadataFor('post', {});
},
recordIsLoaded: function(){
return this.store.recordIsLoaded('post', '1');
},
filter: function(){
return this.store.filter('post', {}, function(post) {
return post.get('published');
});
},
unloadAll: function(){
return this.store.unloadAll('post');
},
recordForId: function(){
return this.store.recordForId('post', '1');
},
hasRecordForId: function(){
return this.store.hasRecordForId('post', '1');
},
getById: function(){
return this.store.getById('post', '1');
},
findByIds: function(){
return this.store.findByIds('post', ['1', '2', '3']);
}
}
});