mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 09:30:31 +03:00
Ensured tags returned from server are used after editing short URL tags in order to use the normalized values
This commit is contained in:
parent
fc1af04243
commit
7d665f3933
2 changed files with 5 additions and 5 deletions
|
@ -40,8 +40,8 @@ export class EditTagsModalComponent extends React.Component {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { shortUrlTagsEdited, shortUrl } = this.props;
|
const { shortUrlTagsEdited, shortUrl, shortUrlTags } = this.props;
|
||||||
const { tags } = this.state;
|
const { tags } = shortUrlTags;
|
||||||
|
|
||||||
shortUrlTagsEdited(shortUrl.shortCode, tags);
|
shortUrlTagsEdited(shortUrl.shortCode, tags);
|
||||||
};
|
};
|
||||||
|
|
|
@ -56,9 +56,9 @@ export const _editShortUrlTags = (shlinkApiClient, shortCode, tags) => async (di
|
||||||
dispatch({ type: EDIT_SHORT_URL_TAGS_START });
|
dispatch({ type: EDIT_SHORT_URL_TAGS_START });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Update short URL tags
|
const normalizedTags = await shlinkApiClient.updateShortUrlTags(shortCode, tags);
|
||||||
await shlinkApiClient.updateShortUrlTags(shortCode, tags);
|
|
||||||
dispatch({ tags, shortCode, type: EDIT_SHORT_URL_TAGS });
|
dispatch({ tags: normalizedTags, shortCode, type: EDIT_SHORT_URL_TAGS });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
dispatch({ type: EDIT_SHORT_URL_TAGS_ERROR });
|
dispatch({ type: EDIT_SHORT_URL_TAGS_ERROR });
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue