File tree 5 files changed +6
-6
lines changed
5 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
# Specify the partial, as well as the name of the variable used in the partial
2
- json . array! @comments , { partial : "comments/comment" , as : :comment }
2
+ json . comments ( @comments , partial : "comments/comment" , as : :comment )
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ export function setIsSaving() {
13
13
} ;
14
14
}
15
15
16
- export function fetchCommentsSuccess ( comments ) {
16
+ export function fetchCommentsSuccess ( data ) {
17
17
return {
18
18
type : actionTypes . FETCH_COMMENTS_SUCCESS ,
19
- comments,
19
+ comments : data . comments ,
20
20
} ;
21
21
}
22
22
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export default class SimpleCommentScreen extends BaseComponent {
30
30
return (
31
31
request
32
32
. get ( 'comments.json' , { responseType : 'json' } )
33
- . then ( res => this . setState ( { $$comments : Immutable . fromJS ( res . data ) } ) )
33
+ . then ( res => this . setState ( { $$comments : Immutable . fromJS ( res . data . comments ) } ) )
34
34
. catch ( error => this . setState ( { fetchCommentsError : error } ) )
35
35
) ;
36
36
}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import reducers from '../reducers';
5
5
import { initalStates } from '../reducers' ;
6
6
7
7
export default props => {
8
- const initialComments = props ;
8
+ const initialComments = props . comments ;
9
9
const { $$commentsState } = initalStates ;
10
10
const initialState = {
11
11
$$commentsStore : $$commentsState . merge ( {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { routerReducer } from 'react-router-redux';
6
6
import { initalStates } from '../reducers' ;
7
7
8
8
export default props => {
9
- const initialComments = props ;
9
+ const initialComments = props . comments ;
10
10
const { $$commentsState } = initalStates ;
11
11
const initialState = {
12
12
$$commentsStore : $$commentsState . merge ( {
You can’t perform that action at this time.
0 commit comments