Ensured domain is passed when editing tags for a short URL on a specific domain

This commit is contained in:
Alejandro Celaya
2020-02-08 09:48:35 +01:00
parent 170e427530
commit 3b95e8ebc0
6 changed files with 18 additions and 15 deletions

View File

@@ -19,7 +19,7 @@ const EditTagsModal = (TagsSelector) => class EditTagsModal extends React.Compon
saveTags = () => {
const { editShortUrlTags, shortUrl, toggle } = this.props;
editShortUrlTags(shortUrl.shortCode, this.state.tags)
editShortUrlTags(shortUrl.shortCode, shortUrl.domain, this.state.tags)
.then(toggle)
.catch(() => {});
};

View File

@@ -40,7 +40,7 @@ export const editShortUrlMeta = (buildShlinkApiClient) => (shortCode, meta) => a
const { updateShortUrlMeta } = await buildShlinkApiClient(getState);
try {
await updateShortUrlMeta(shortCode, meta);
await updateShortUrlMeta(shortCode, undefined, meta);
dispatch({ shortCode, meta, type: SHORT_URL_META_EDITED });
} catch (e) {
dispatch({ type: EDIT_SHORT_URL_META_ERROR });

View File

@@ -29,12 +29,12 @@ export default handleActions({
[RESET_EDIT_SHORT_URL_TAGS]: () => initialState,
}, initialState);
export const editShortUrlTags = (buildShlinkApiClient) => (shortCode, tags) => async (dispatch, getState) => {
export const editShortUrlTags = (buildShlinkApiClient) => (shortCode, domain, tags) => async (dispatch, getState) => {
dispatch({ type: EDIT_SHORT_URL_TAGS_START });
const { updateShortUrlTags } = await buildShlinkApiClient(getState);
try {
const normalizedTags = await updateShortUrlTags(shortCode, tags);
const normalizedTags = await updateShortUrlTags(shortCode, domain, tags);
dispatch({ tags: normalizedTags, shortCode, type: SHORT_URL_TAGS_EDITED });
} catch (e) {