diff --git a/src/short-urls/helpers/EditTagsModal.js b/src/short-urls/helpers/EditTagsModal.js index c3832bb5..83d94470 100644 --- a/src/short-urls/helpers/EditTagsModal.js +++ b/src/short-urls/helpers/EditTagsModal.js @@ -40,8 +40,8 @@ export class EditTagsModalComponent extends React.Component { return; } - const { shortUrlTagsEdited, shortUrl } = this.props; - const { tags } = this.state; + const { shortUrlTagsEdited, shortUrl, shortUrlTags } = this.props; + const { tags } = shortUrlTags; shortUrlTagsEdited(shortUrl.shortCode, tags); }; diff --git a/src/short-urls/reducers/shortUrlTags.js b/src/short-urls/reducers/shortUrlTags.js index a24fb7ee..597c5a89 100644 --- a/src/short-urls/reducers/shortUrlTags.js +++ b/src/short-urls/reducers/shortUrlTags.js @@ -56,9 +56,9 @@ export const _editShortUrlTags = (shlinkApiClient, shortCode, tags) => async (di dispatch({ type: EDIT_SHORT_URL_TAGS_START }); try { - // Update short URL tags - await shlinkApiClient.updateShortUrlTags(shortCode, tags); - dispatch({ tags, shortCode, type: EDIT_SHORT_URL_TAGS }); + const normalizedTags = await shlinkApiClient.updateShortUrlTags(shortCode, tags); + + dispatch({ tags: normalizedTags, shortCode, type: EDIT_SHORT_URL_TAGS }); } catch (e) { dispatch({ type: EDIT_SHORT_URL_TAGS_ERROR });