Removed unecesary check

This commit is contained in:
Alejandro Celaya 2021-12-14 23:12:39 +01:00
parent ed1f650fc6
commit 7d6afd47b1

View file

@ -23,11 +23,7 @@ import { stringifyQuery } from '../../utils/helpers/query';
const buildShlinkBaseUrl = (url: string, apiVersion: number) => url ? `${url}/rest/v${apiVersion}` : '';
const rejectNilProps = reject(isNil);
const normalizeOrderByInParams = (params: ShlinkShortUrlsListParams): ShlinkShortUrlsListNormalizedParams => {
if (!params.orderBy) {
return params as ShlinkShortUrlsListNormalizedParams;
}
const { orderBy, ...rest } = params;
const { orderBy = {}, ...rest } = params;
const [ firstKey ] = Object.keys(orderBy);
const [ firstValue ] = Object.values(orderBy);