mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-15 20:13:48 +00:00
More components migrated to TS
This commit is contained in:
@@ -3,6 +3,7 @@ import { Action, Dispatch } from 'redux';
|
||||
import { buildReducer } from '../../utils/helpers/redux';
|
||||
import { ShlinkApiClientBuilder } from '../../utils/services/types';
|
||||
import { GetState } from '../../container/types';
|
||||
import { OptionalString } from '../../utils/utils';
|
||||
|
||||
/* eslint-disable padding-line-between-statements */
|
||||
export const EDIT_SHORT_URL_START = 'shlink/shortUrlEdition/EDIT_SHORT_URL_START';
|
||||
@@ -28,7 +29,7 @@ export interface ShortUrlEdition {
|
||||
export interface ShortUrlEditedAction extends Action<string> {
|
||||
shortCode: string;
|
||||
longUrl: string;
|
||||
domain: string | undefined | null;
|
||||
domain: OptionalString;
|
||||
}
|
||||
|
||||
const initialState: ShortUrlEdition = {
|
||||
@@ -46,7 +47,7 @@ export default buildReducer<ShortUrlEdition, ShortUrlEditedAction>({
|
||||
|
||||
export const editShortUrl = (buildShlinkApiClient: ShlinkApiClientBuilder) => (
|
||||
shortCode: string,
|
||||
domain: string | undefined | null,
|
||||
domain: OptionalString,
|
||||
longUrl: string,
|
||||
) => async (dispatch: Dispatch, getState: GetState) => {
|
||||
dispatch({ type: EDIT_SHORT_URL_START });
|
||||
|
||||
@@ -4,6 +4,7 @@ import { ShortUrlMeta } from '../data';
|
||||
import { ShlinkApiClientBuilder } from '../../utils/services/types';
|
||||
import { GetState } from '../../container/types';
|
||||
import { buildActionCreator, buildReducer } from '../../utils/helpers/redux';
|
||||
import { OptionalString } from '../../utils/utils';
|
||||
|
||||
/* eslint-disable padding-line-between-statements */
|
||||
export const EDIT_SHORT_URL_META_START = 'shlink/shortUrlMeta/EDIT_SHORT_URL_META_START';
|
||||
@@ -19,14 +20,6 @@ export const shortUrlMetaType = PropTypes.shape({
|
||||
maxVisits: PropTypes.number,
|
||||
});
|
||||
|
||||
/** @deprecated Use ShortUrlMetaEdition interface instead */
|
||||
export const shortUrlEditMetaType = PropTypes.shape({
|
||||
shortCode: PropTypes.string,
|
||||
meta: shortUrlMetaType.isRequired,
|
||||
saving: PropTypes.bool.isRequired,
|
||||
error: PropTypes.bool.isRequired,
|
||||
});
|
||||
|
||||
export interface ShortUrlMetaEdition {
|
||||
shortCode: string | null;
|
||||
meta: ShortUrlMeta;
|
||||
@@ -56,7 +49,7 @@ export default buildReducer<ShortUrlMetaEdition, ShortUrlMetaEditedAction>({
|
||||
|
||||
export const editShortUrlMeta = (buildShlinkApiClient: ShlinkApiClientBuilder) => (
|
||||
shortCode: string,
|
||||
domain: string | null | undefined,
|
||||
domain: OptionalString,
|
||||
meta: ShortUrlMeta,
|
||||
) => async (dispatch: Dispatch, getState: GetState) => {
|
||||
dispatch({ type: EDIT_SHORT_URL_META_START });
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Action, Dispatch } from 'redux';
|
||||
import { buildActionCreator, buildReducer } from '../../utils/helpers/redux';
|
||||
import { ShlinkApiClientBuilder } from '../../utils/services/types';
|
||||
import { GetState } from '../../container/types';
|
||||
import { OptionalString } from '../../utils/utils';
|
||||
|
||||
/* eslint-disable padding-line-between-statements */
|
||||
export const EDIT_SHORT_URL_TAGS_START = 'shlink/shortUrlTags/EDIT_SHORT_URL_TAGS_START';
|
||||
@@ -29,7 +30,7 @@ export interface ShortUrlTags {
|
||||
export interface EditShortUrlTagsAction extends Action<string> {
|
||||
shortCode: string;
|
||||
tags: string[];
|
||||
domain: string | null | undefined;
|
||||
domain: OptionalString;
|
||||
}
|
||||
|
||||
const initialState: ShortUrlTags = {
|
||||
@@ -48,7 +49,7 @@ export default buildReducer<ShortUrlTags, EditShortUrlTagsAction>({
|
||||
|
||||
export const editShortUrlTags = (buildShlinkApiClient: ShlinkApiClientBuilder) => (
|
||||
shortCode: string,
|
||||
domain: string | null | undefined,
|
||||
domain: OptionalString,
|
||||
tags: string[],
|
||||
) => async (dispatch: Dispatch, getState: GetState) => {
|
||||
dispatch({ type: EDIT_SHORT_URL_TAGS_START });
|
||||
|
||||
Reference in New Issue
Block a user