Skip to content

Commit

Permalink
Add baseUrl to management export urls (#915)
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Feb 13, 2024
1 parent a9de0b1 commit b8d5db2
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import PropTypes from 'prop-types'
import isNil from 'lodash/isNil'
import invert from 'lodash/invert'

import baseUrl from 'rdmo/core/assets/js/utils/baseUrl'

import { elementTypes, elementModules } from '../../constants/elements'

import { buildPath } from '../../utils/location'
Expand All @@ -16,8 +18,8 @@ const ElementsSidebar = ({ config, elements, elementActions, importActions }) =>
const { elementType, elementId } = elements

const model = invert(elementTypes)[elementType]
const exportUrl = isNil(elementId) ? `/api/v1/${elementModules[model]}/${elementType}/export/`
: `/api/v1/${elementModules[model]}/${elementType}/${elementId}/export/`
const exportUrl = isNil(elementId) ? `${baseUrl}/api/v1/${elementModules[model]}/${elementType}/export/`
: `${baseUrl}/api/v1/${elementModules[model]}/${elementType}/${elementId}/export/`
const exportParams = getExportParams(config.filter[elementType])

return (
Expand All @@ -27,7 +29,7 @@ const ElementsSidebar = ({ config, elements, elementActions, importActions }) =>
<ul className="list-unstyled">
<li>
<Link href={buildPath(config.baseUrl, 'catalogs')}
onClick={() => elementActions.fetchElements('catalogs')}>{gettext('Catalogs')}</Link>
onClick={() => elementActions.fetchElements('catalogs')}>{gettext('Catalogs1')}</Link>
</li>
<li>
<Link href={buildPath(config.baseUrl, 'sections')}
Expand Down

0 comments on commit b8d5db2

Please sign in to comment.