mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-15 03:53:51 +00:00
Refactored editShortUrl action to require just one param
This commit is contained in:
@@ -20,6 +20,12 @@ export interface ShortUrlEdition {
|
||||
errorData?: ProblemDetailsError;
|
||||
}
|
||||
|
||||
export interface EditShortUrl {
|
||||
shortCode: string;
|
||||
domain?: OptionalString;
|
||||
data: EditShortUrlData;
|
||||
}
|
||||
|
||||
export type ShortUrlEditedAction = PayloadAction<ShortUrl>;
|
||||
|
||||
const initialState: ShortUrlEdition = {
|
||||
@@ -34,9 +40,7 @@ export default buildReducer<ShortUrlEdition, ShortUrlEditedAction & ApiErrorActi
|
||||
}, initialState);
|
||||
|
||||
export const editShortUrl = (buildShlinkApiClient: ShlinkApiClientBuilder) => (
|
||||
shortCode: string,
|
||||
domain: OptionalString,
|
||||
data: EditShortUrlData,
|
||||
{ shortCode, domain, data }: EditShortUrl,
|
||||
) => async (dispatch: Dispatch, getState: GetState) => {
|
||||
dispatch({ type: EDIT_SHORT_URL_START });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user