Migrated short URL helper modal components to TS

This commit is contained in:
Alejandro Celaya
2020-08-26 20:37:36 +02:00
parent b19bbee7fc
commit f283dc8569
14 changed files with 90 additions and 130 deletions

View File

@@ -1,6 +1,4 @@
import PropTypes from 'prop-types';
import { Action, Dispatch } from 'redux';
import { apiErrorType } from '../../utils/services/ShlinkApiClient';
import { buildActionCreator, buildReducer } from '../../utils/helpers/redux';
import { ProblemDetailsError, ShlinkApiClientBuilder } from '../../utils/services/types';
import { GetState } from '../../container/types';
@@ -12,14 +10,6 @@ export const SHORT_URL_DELETED = 'shlink/deleteShortUrl/SHORT_URL_DELETED';
export const RESET_DELETE_SHORT_URL = 'shlink/deleteShortUrl/RESET_DELETE_SHORT_URL';
/* eslint-enable padding-line-between-statements */
/** @deprecated Use ShortUrlDeletion interface */
export const shortUrlDeletionType = PropTypes.shape({
shortCode: PropTypes.string.isRequired,
loading: PropTypes.bool.isRequired,
error: PropTypes.bool.isRequired,
errorData: apiErrorType.isRequired,
});
export interface ShortUrlDeletion {
shortCode: string;
loading: boolean;

View File

@@ -1,4 +1,3 @@
import PropTypes from 'prop-types';
import { Action, Dispatch } from 'redux';
import { buildReducer } from '../../utils/helpers/redux';
import { ShlinkApiClientBuilder } from '../../utils/services/types';
@@ -11,14 +10,6 @@ export const EDIT_SHORT_URL_ERROR = 'shlink/shortUrlEdition/EDIT_SHORT_URL_ERROR
export const SHORT_URL_EDITED = 'shlink/shortUrlEdition/SHORT_URL_EDITED';
/* eslint-enable padding-line-between-statements */
/** @deprecated Use ShortUrlEdition interface instead */
export const ShortUrlEditionType = PropTypes.shape({
shortCode: PropTypes.string,
longUrl: PropTypes.string,
saving: PropTypes.bool.isRequired,
error: PropTypes.bool.isRequired,
});
export interface ShortUrlEdition {
shortCode: string | null;
longUrl: string | null;