mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-02-27 20:26:40 +00:00
Removed no longer used dependencies
This commit is contained in:
@@ -2,7 +2,7 @@ import qs from 'qs';
|
||||
import { isEmpty, isNil, reject } from 'ramda';
|
||||
import { AxiosInstance, AxiosResponse, Method } from 'axios';
|
||||
import { ShortUrlsListParams } from '../../short-urls/reducers/shortUrlsListParams';
|
||||
import { ShortUrl } from '../../short-urls/data';
|
||||
import { ShortUrl, ShortUrlData } from '../../short-urls/data';
|
||||
import { OptionalString } from '../utils';
|
||||
import {
|
||||
ShlinkHealth,
|
||||
@@ -33,8 +33,8 @@ export default class ShlinkApiClient {
|
||||
this.performRequest<{ shortUrls: ShlinkShortUrlsResponse }>('/short-urls', 'GET', params)
|
||||
.then(({ data }) => data.shortUrls);
|
||||
|
||||
public readonly createShortUrl = async (options: any): Promise<ShortUrl> => { // TODO CreateShortUrl interface
|
||||
const filteredOptions = reject((value) => isEmpty(value) || isNil(value), options);
|
||||
public readonly createShortUrl = async (options: ShortUrlData): Promise<ShortUrl> => {
|
||||
const filteredOptions = reject((value) => isEmpty(value) || isNil(value), options as any);
|
||||
|
||||
return this.performRequest<ShortUrl>('/short-urls', 'POST', {}, filteredOptions)
|
||||
.then((resp) => resp.data);
|
||||
|
||||
@@ -25,12 +25,12 @@ interface ShlinkTagsStats {
|
||||
|
||||
export interface ShlinkTags {
|
||||
tags: string[];
|
||||
stats?: ShlinkTagsStats[]; // TODO Is only optional in old versions
|
||||
stats?: ShlinkTagsStats[]; // Is only optional in old Shlink versions
|
||||
}
|
||||
|
||||
export interface ShlinkTagsResponse {
|
||||
data: string[];
|
||||
stats?: ShlinkTagsStats[]; // TODO Is only optional in old versions
|
||||
stats?: ShlinkTagsStats[]; // Is only optional in old Shlink versions
|
||||
}
|
||||
|
||||
export interface ShlinkPaginator {
|
||||
@@ -40,7 +40,7 @@ export interface ShlinkPaginator {
|
||||
|
||||
export interface ShlinkVisits {
|
||||
data: Visit[];
|
||||
pagination?: ShlinkPaginator; // TODO Is only optional in old versions
|
||||
pagination?: ShlinkPaginator; // Is only optional in old Shlink versions
|
||||
}
|
||||
|
||||
export interface ShlinkVisitsParams {
|
||||
|
||||
@@ -68,7 +68,6 @@ const determineHeight = (isBarChart: boolean, labels: string[]): number | undefi
|
||||
return isBarChart && labels.length > 20 ? labels.length * 8 : undefined;
|
||||
};
|
||||
|
||||
/* eslint-disable react/prop-types */
|
||||
const renderPieChartLegend = ({ config }: Chart) => {
|
||||
const { labels = [], datasets = [] } = config.data ?? {};
|
||||
const { defaultColor } = config.options ?? {} as any;
|
||||
@@ -88,7 +87,6 @@ const renderPieChartLegend = ({ config }: Chart) => {
|
||||
</ul>
|
||||
);
|
||||
};
|
||||
/* eslint-enable react/prop-types */
|
||||
|
||||
const chartElementAtEvent = (onClick?: (label: string) => void) => ([ chart ]: [{ _index: number; _chart: Chart }]) => {
|
||||
if (!onClick || !chart) {
|
||||
|
||||
Reference in New Issue
Block a user