File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -733,7 +733,9 @@ function get(Model, id) {
733
733
734
734
if ( cachedModel ) definitions . set ( cachedModel , null ) ;
735
735
return setTimestamp (
736
- config . create ( stringId ? { ...result , id : stringId } : result ) ,
736
+ config . create (
737
+ ! config . list && stringId ? { ...result , id : stringId } : result ,
738
+ ) ,
737
739
) ;
738
740
} catch ( e ) {
739
741
return setTimestamp (
Original file line number Diff line number Diff line change @@ -1435,6 +1435,13 @@ describe("store:", () => {
1435
1435
] ) ;
1436
1436
} ) ;
1437
1437
1438
+ it ( "returns a list of models with parameters" , ( ) => {
1439
+ expect ( store . get ( [ Model ] , { page : 1 } ) ) . toEqual ( [
1440
+ { id : "1" , value : "test" } ,
1441
+ { id : "2" , value : "other" } ,
1442
+ ] ) ;
1443
+ } ) ;
1444
+
1438
1445
it ( "adds item to list of models" , done => {
1439
1446
expect ( store . get ( [ Model ] ) . length ) . toBe ( 2 ) ;
1440
1447
store
@@ -1589,7 +1596,9 @@ describe("store:", () => {
1589
1596
const setupDep = options => {
1590
1597
return {
1591
1598
items : [ Model , options ] ,
1592
- [ store . connect ] : ( ) => ( { items : Object . keys ( storage ) . map ( key => storage [ key ] ) } ) ,
1599
+ [ store . connect ] : ( ) => ( {
1600
+ items : Object . keys ( storage ) . map ( key => storage [ key ] ) ,
1601
+ } ) ,
1593
1602
} ;
1594
1603
} ;
1595
1604
You can’t perform that action at this time.
0 commit comments