Removed params param when dispatching list short RULs action, as it was used by a reducer that has been deleted

This commit is contained in:
Alejandro Celaya 2021-12-24 15:05:15 +01:00
parent 86c6acb7b8
commit eaadd6f7af
2 changed files with 4 additions and 5 deletions

View file

@ -24,7 +24,6 @@ export interface ShortUrlsList {
export interface ListShortUrlsAction extends Action<string> {
shortUrls: ShlinkShortUrlsResponse;
params: ShlinkShortUrlsListParams;
}
export type ListShortUrlsCombinedAction = (
@ -108,8 +107,8 @@ export const listShortUrls = (buildShlinkApiClient: ShlinkApiClientBuilder) => (
try {
const shortUrls = await listShortUrls(params);
dispatch<ListShortUrlsAction>({ type: LIST_SHORT_URLS, shortUrls, params });
dispatch<ListShortUrlsAction>({ type: LIST_SHORT_URLS, shortUrls });
} catch (e) {
dispatch({ type: LIST_SHORT_URLS_ERROR, params });
dispatch({ type: LIST_SHORT_URLS_ERROR });
}
};

View file

@ -175,7 +175,7 @@ describe('shortUrlsListReducer', () => {
expect(dispatch).toHaveBeenCalledTimes(2);
expect(dispatch).toHaveBeenNthCalledWith(1, { type: LIST_SHORT_URLS_START });
expect(dispatch).toHaveBeenNthCalledWith(2, { type: LIST_SHORT_URLS, shortUrls: [], params: {} });
expect(dispatch).toHaveBeenNthCalledWith(2, { type: LIST_SHORT_URLS, shortUrls: [] });
expect(listShortUrlsMock).toHaveBeenCalledTimes(1);
});
@ -188,7 +188,7 @@ describe('shortUrlsListReducer', () => {
expect(dispatch).toHaveBeenCalledTimes(2);
expect(dispatch).toHaveBeenNthCalledWith(1, { type: LIST_SHORT_URLS_START });
expect(dispatch).toHaveBeenNthCalledWith(2, { type: LIST_SHORT_URLS_ERROR, params: {} });
expect(dispatch).toHaveBeenNthCalledWith(2, { type: LIST_SHORT_URLS_ERROR });
expect(listShortUrlsMock).toHaveBeenCalledTimes(1);
});