You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
388 B
16 lines
388 B
import { queryString } from 'educoder'
|
|
export function updatePageParams(pageNum, props) {
|
|
const url = props.match.url
|
|
|
|
const _search = props.location.search;
|
|
let parsed = {};
|
|
if (_search) {
|
|
parsed = queryString.parse(_search);
|
|
}
|
|
|
|
// 修改page參數
|
|
parsed.page = pageNum
|
|
|
|
props.history.push(`${url}?${queryString.stringify(parsed)}`)
|
|
}
|