From 07220518a74e3bcbc0229c94c693a218da41fa3b Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Sat, 4 Nov 2017 19:51:01 -0400 Subject: [PATCH] Fix number parsing in tag route prepare Params come through as string, needs to be numeric, cast in prepareRoute (simplify to Number cast) --- src/routes/tag.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/tag.js b/src/routes/tag.js index 979d881f9..d0489053a 100644 --- a/src/routes/tag.js +++ b/src/routes/tag.js @@ -3,7 +3,7 @@ */ import { createElement } from 'preact'; import { connect } from 'preact-redux'; -import { defaultTo, toNumber } from 'lodash'; +import { defaultTo } from 'lodash'; /** * Internal dependencies @@ -34,11 +34,11 @@ TagRoute.prepareRoute = ( { params } ) => [ requestUsers(), requestDones( { tag: params.tag, - page: params.page || 1, + page: Number( params.page ) || 1, } ), ]; export default connect( ( state ) => ( { tag: getRouteParam( state, 'tag' ), - page: toNumber( defaultTo( getRouteParam( state, 'page' ), 1 ) ), + page: Number( defaultTo( getRouteParam( state, 'page' ), 1 ) ), } ) )( TagRoute );