Ensured domain is passed when loading detail for a short URL on a specific domain

This commit is contained in:
Alejandro Celaya
2020-02-08 09:38:19 +01:00
parent 707c9f4ce6
commit 170e427530
2 changed files with 9 additions and 9 deletions

View File

@@ -26,13 +26,13 @@ export default handleActions({
[GET_SHORT_URL_DETAIL]: (state, { shortUrl }) => ({ shortUrl, loading: false, error: false }),
}, initialState);
export const getShortUrlDetail = (buildShlinkApiClient) => (shortCode) => async (dispatch, getState) => {
export const getShortUrlDetail = (buildShlinkApiClient) => (shortCode, domain) => async (dispatch, getState) => {
dispatch({ type: GET_SHORT_URL_DETAIL_START });
const { getShortUrl } = await buildShlinkApiClient(getState);
try {
const shortUrl = await getShortUrl(shortCode);
const shortUrl = await getShortUrl(shortCode, domain);
dispatch({ shortUrl, type: GET_SHORT_URL_DETAIL });
} catch (e) {