@campxdev/shared 3.1.24 → 3.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "3.1.24",
3
+ "version": "3.1.26",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -52,7 +52,7 @@ const RenderLink = ({ link, isActive }) => {
52
52
  return (
53
53
  <StyledLinkWrapper>
54
54
  {isProd &&
55
- window.location.hostname.split('.')[0] === link?.item?.appKey ? (
55
+ window.location.hostname.split('.')[0].split('--')[0] === link?.item?.appKey ? (
56
56
  <Link to={link?.item?.path} ref={reactLinkRef}>
57
57
  <StyledListItem isActive={isActive}>{link?.title}</StyledListItem>
58
58
  </Link>
@@ -55,7 +55,7 @@ export function LoginForm({
55
55
  try {
56
56
  const res = await axiosBase({
57
57
  method: 'POST',
58
- baseURL: process.env.REACT_APP_API_HOST,
58
+ baseURL: process.env.REACT_APP_API_HOST || '/api',
59
59
  url: loginUrl ? loginUrl : `/auth-server/auth/login`,
60
60
  data: {
61
61
  ...values,
@@ -13,7 +13,7 @@ declare module 'axios' {
13
13
 
14
14
  export const isDevelopment = window.location.hostname.includes('localhost')
15
15
 
16
- const tenantCode = window.location.hostname.split('.')[0]
16
+ const tenantCode = window.location.hostname.split('.')[0].split('--')[0]
17
17
  const institutionCode = window.location.pathname.split('/')[1]
18
18
 
19
19
  // Workspace to API endpoint prefix mapping
@@ -51,7 +51,7 @@ export const formatParams = (params) => {
51
51
  }
52
52
 
53
53
  let axios = Axios.create({
54
- baseURL: process.env.REACT_APP_API_HOST,
54
+ baseURL: process.env.REACT_APP_API_HOST || '/api',
55
55
  withCredentials: true,
56
56
  headers: {
57
57
  'x-tenant-id': tenantCode,
@@ -9,7 +9,7 @@ const clientId = window.location.pathname.split('/')[1] ?? 'campx_dev'
9
9
  const evaluatorKey = Cookies.get('campx_evaluator_key')
10
10
 
11
11
  const axiosEvaluator = Axios.create({
12
- baseURL: process.env.REACT_APP_API_HOST,
12
+ baseURL: process.env.REACT_APP_API_HOST || '/api',
13
13
  withCredentials: true,
14
14
  headers: {
15
15
  'x-tenant-id': clientId,
@@ -11,7 +11,7 @@ const evaluatorKey = Cookies.get('campx_evaluator_key')
11
11
  const openPaymentsKey = Cookies.get('campx_open_payments_key')
12
12
 
13
13
  const axiosTenant = Axios.create({
14
- baseURL: process.env.REACT_APP_API_HOST,
14
+ baseURL: process.env.REACT_APP_API_HOST || '/api',
15
15
  withCredentials: true,
16
16
  headers: {
17
17
  'x-tenant-id': clientId,
@@ -27,7 +27,7 @@ export const batchOptions = (() => {
27
27
  })
28
28
 
29
29
  // Check if current tenant has specific batch configuration
30
- const tenantConfig = tenantBatchConfig[window.location.hostname.split('.')[0]]
30
+ const tenantConfig = tenantBatchConfig[window.location.hostname.split('.')[0].split('--')[0]]
31
31
 
32
32
  if (tenantConfig) {
33
33
  const { batchConfigs } = tenantConfig
@@ -12,13 +12,13 @@ import RootModal from './RootModal'
12
12
 
13
13
  const isDevelopment = window.location.hostname.includes('localhost')
14
14
 
15
- export const campxTenantKey = window.location.hostname.split('.')[0]
16
- export const urlTenantKey = window.location.hostname.split('.')[0]
15
+ export const campxTenantKey = window.location.hostname.split('.')[0].split('--')[0]
16
+ export const urlTenantKey = window.location.hostname.split('.')[0].split('--')[0]
17
17
  export const instituitionKey = window.location.pathname.split('/')[1]
18
18
 
19
19
  export default function Providers({ children }: { children: ReactNode }) {
20
20
  var baseName = '/'
21
- var tenantCode = window.location.hostname.split('.')[0]
21
+ var tenantCode = window.location.hostname.split('.')[0].split('--')[0]
22
22
  var institutionCode = window.location.pathname.split('/')[1]
23
23
 
24
24
  if (institutionCode && window.location.pathname !== '/auth/login') {
@@ -4,7 +4,7 @@ import axios, { axiosErrorToast } from '../config/axios'
4
4
  export default function logout() {
5
5
  axios({
6
6
  method: 'POST',
7
- baseURL: process.env.REACT_APP_API_HOST,
7
+ baseURL: process.env.REACT_APP_API_HOST || '/api',
8
8
  url: '/auth-server/auth/logout',
9
9
  })
10
10
  .then((res) => {