@@ -100,54 +100,54 @@ export function createEntityMethods<
100100 const reducer = reducerCreator . create
101101 const reducers : EntityReducers < T , Id , State , 's' , 'p' > = {
102102 [ `addOne${ capitalize ( name ) } ` as const ] : reducer < T > ( ( state , action ) => {
103- adapter . addOne ( selectEntityState ( state ) , action . payload )
103+ adapter . addOne ( selectEntityState ( state ) , action )
104104 } ) ,
105105 [ `addMany${ capitalize ( pluralName ) } ` as const ] : reducer <
106106 readonly T [ ] | Record < Id , T >
107107 > ( ( state , action ) => {
108- adapter . addMany ( selectEntityState ( state ) , action . payload )
108+ adapter . addMany ( selectEntityState ( state ) , action )
109109 } ) ,
110110 [ `setOne${ capitalize ( name ) } ` as const ] : reducer < T > ( ( state , action ) => {
111- adapter . setOne ( selectEntityState ( state ) , action . payload )
111+ adapter . setOne ( selectEntityState ( state ) , action )
112112 } ) ,
113113 [ `setMany${ capitalize ( pluralName ) } ` as const ] : reducer <
114114 readonly T [ ] | Record < Id , T >
115115 > ( ( state , action ) => {
116- adapter . setMany ( selectEntityState ( state ) , action . payload )
116+ adapter . setMany ( selectEntityState ( state ) , action )
117117 } ) ,
118118 [ `setAll${ capitalize ( pluralName ) } ` as const ] : reducer <
119119 readonly T [ ] | Record < Id , T >
120120 > ( ( state , action ) => {
121- adapter . setAll ( selectEntityState ( state ) , action . payload )
121+ adapter . setAll ( selectEntityState ( state ) , action )
122122 } ) ,
123123 [ `removeOne${ capitalize ( name ) } ` as const ] : reducer < Id > ( ( state , action ) => {
124- adapter . removeOne ( selectEntityState ( state ) , action . payload )
124+ adapter . removeOne ( selectEntityState ( state ) , action )
125125 } ) ,
126126 [ `removeMany${ capitalize ( pluralName ) } ` as const ] : reducer < readonly Id [ ] > (
127127 ( state , action ) => {
128- adapter . removeMany ( selectEntityState ( state ) , action . payload )
128+ adapter . removeMany ( selectEntityState ( state ) , action )
129129 } ,
130130 ) ,
131131 [ `removeAll${ capitalize ( pluralName ) } ` as const ] : reducer ( ( state ) => {
132132 adapter . removeAll ( selectEntityState ( state ) )
133133 } ) ,
134134 [ `upsertOne${ capitalize ( name ) } ` as const ] : reducer < T > ( ( state , action ) => {
135- adapter . upsertOne ( selectEntityState ( state ) , action . payload )
135+ adapter . upsertOne ( selectEntityState ( state ) , action )
136136 } ) ,
137137 [ `upsertMany${ capitalize ( pluralName ) } ` as const ] : reducer <
138138 readonly T [ ] | Record < Id , T >
139139 > ( ( state , action ) => {
140- adapter . upsertMany ( selectEntityState ( state ) , action . payload )
140+ adapter . upsertMany ( selectEntityState ( state ) , action )
141141 } ) ,
142142 [ `updateOne${ capitalize ( name ) } ` as const ] : reducer < Update < T , Id > > (
143143 ( state , action ) => {
144- adapter . updateOne ( selectEntityState ( state ) , action . payload )
144+ adapter . updateOne ( selectEntityState ( state ) , action )
145145 } ,
146146 ) ,
147147 [ `updateMany${ capitalize ( pluralName ) } ` as const ] : reducer <
148148 readonly Update < T , Id > [ ]
149149 > ( ( state , action ) => {
150- adapter . updateMany ( selectEntityState ( state ) , action . payload )
150+ adapter . updateMany ( selectEntityState ( state ) , action )
151151 } ) ,
152152 }
153153 return reducers as any
0 commit comments