@@ -199,9 +199,7 @@ describe('createAPIAction()', () => {
199
199
describe ( 'Testing Custom Endpoints' , ( ) => {
200
200
const type = 'TYPE' ;
201
201
it ( 'test GET with Custom Endpoint' , ( ) => {
202
- const customEndpoint = ( ) => {
203
- return '/tester/mctesterson' ;
204
- } ;
202
+ const customEndpoint = ( ) => '/tester/mctesterson' ;
205
203
const getItems = createAPIAction ( type , 'GET' , customEndpoint ) ;
206
204
expect ( getItems ( ) ) . to . deep . equal ( {
207
205
type,
@@ -220,9 +218,7 @@ describe('createAPIAction()', () => {
220
218
} ) ;
221
219
222
220
it ( 'test Get by ID with Custom Endpoint' , ( ) => {
223
- const customEndpoint = ( p ) => {
224
- return `/tester/${ p } /mctesterson` ;
225
- } ;
221
+ const customEndpoint = ( p ) => `/tester/${ p } /mctesterson` ;
226
222
const getItems = createAPIAction ( type , 'GET' , customEndpoint ) ;
227
223
expect ( getItems ( 10 ) ) . to . deep . equal ( {
228
224
type,
@@ -241,9 +237,7 @@ describe('createAPIAction()', () => {
241
237
} ) ;
242
238
243
239
it ( 'test POST with Custom Endpoint' , ( ) => {
244
- const customEndpoint = ( params ) => {
245
- return `/user/${ params . id } /ronald/${ params . name } ` ;
246
- } ;
240
+ const customEndpoint = ( params ) => `/user/${ params . id } /ronald/${ params . name } ` ;
247
241
const createItem = createAPIAction ( type , 'POST' , customEndpoint ) ;
248
242
const payload = { id : 10 , name : 'james' } ;
249
243
expect ( createItem ( payload ) ) . to . deep . equal ( {
@@ -263,9 +257,7 @@ describe('createAPIAction()', () => {
263
257
} ) ;
264
258
265
259
it ( 'test PUT with Custom Endpoint' , ( ) => {
266
- const customEndpoint = ( params ) => {
267
- return `/user/${ params . id } ` ;
268
- } ;
260
+ const customEndpoint = ( params ) => `/user/${ params . id } ` ;
269
261
const updateItem = createAPIAction ( type , 'PUT' , customEndpoint ) ;
270
262
const payload = { id : 10 , name : 'james' } ;
271
263
expect ( updateItem ( payload ) ) . to . deep . equal ( {
@@ -285,9 +277,7 @@ describe('createAPIAction()', () => {
285
277
} ) ;
286
278
287
279
it ( 'test DELETE with Custom Endpoint' , ( ) => {
288
- const customEndpoint = ( { id, accountID} ) => {
289
- return `/user/${ id } /account/${ accountID } ` ;
290
- } ;
280
+ const customEndpoint = ( { id, accountID } ) => `/user/${ id } /account/${ accountID } ` ;
291
281
const deleteItem = createAPIAction ( type , 'DELETE' , customEndpoint ) ;
292
282
const payload = { id : 10 , accountID : 25 } ;
293
283
expect ( deleteItem ( payload ) ) . to . deep . equal ( {
0 commit comments