diff --git a/src/components/database/DatabaseListItem.tsx b/src/components/database/DatabaseListItem.tsx index d99b3fc..1720cbe 100644 --- a/src/components/database/DatabaseListItem.tsx +++ b/src/components/database/DatabaseListItem.tsx @@ -73,15 +73,15 @@ class DatabaseListItem extends Component { } getListUrl(query: { orderby?: string, order_dir?: number, limit?: number, page?: number }) { - const newOrderby: string = typeof query.orderby !== 'undefined' ? query.orderby : this.state.condition.orderBy; + const newOrderBy: string = typeof query.orderby !== 'undefined' ? query.orderby : this.state.condition.orderBy; const newOrderDir: number = typeof query.order_dir !== 'undefined' ? query.order_dir : this.state.condition.orderDir; const newLimit: number = typeof query.limit !== 'undefined' ? query.limit : this.state.condition.limit; let newPage: number = typeof query.page !== 'undefined' ? query.page : this.state.condition.page; - if (newLimit !== this.state.condition.limit) { + if (newLimit !== this.state.condition.limit || newOrderBy !== this.state.condition.orderBy) { newPage = SORT_CONDITION_DEFAULT.page; } let params: string[] = []; - params.push('orderby=' + newOrderby); + params.push('orderby=' + newOrderBy); params.push('order_dir=' + String(newOrderDir)); params.push('itemcount=' + String(newLimit)); params.push('page=' + String(newPage));