mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-15 12:03:46 +00:00
Removed shortUrlsListParams reducer, as the state is now handled internally in the component
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
import { buildActionCreator, buildReducer } from '../../utils/helpers/redux';
|
||||
import { Order } from '../../utils/helpers/ordering';
|
||||
import { LIST_SHORT_URLS, ListShortUrlsAction } from './shortUrlsList';
|
||||
|
||||
export const RESET_SHORT_URL_PARAMS = 'shlink/shortUrlsListParams/RESET_SHORT_URL_PARAMS';
|
||||
|
||||
export const SORTABLE_FIELDS = {
|
||||
dateCreated: 'Created at',
|
||||
@@ -15,20 +11,3 @@ export const SORTABLE_FIELDS = {
|
||||
export type OrderableFields = keyof typeof SORTABLE_FIELDS;
|
||||
|
||||
export type ShortUrlsOrder = Order<OrderableFields>;
|
||||
|
||||
export interface ShortUrlsListParams {
|
||||
page?: string;
|
||||
itemsPerPage?: number;
|
||||
orderBy?: ShortUrlsOrder;
|
||||
}
|
||||
|
||||
const initialState: ShortUrlsListParams = {
|
||||
page: '1',
|
||||
};
|
||||
|
||||
export default buildReducer<ShortUrlsListParams, ListShortUrlsAction>({
|
||||
[LIST_SHORT_URLS]: (state, { params }) => ({ ...state, ...params }),
|
||||
[RESET_SHORT_URL_PARAMS]: () => initialState,
|
||||
}, initialState);
|
||||
|
||||
export const resetShortUrlParams = buildActionCreator(RESET_SHORT_URL_PARAMS);
|
||||
|
||||
Reference in New Issue
Block a user