@swiss-ai-hub/web 0.295.2 → 0.295.4

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.
@@ -1,4 +1,4 @@
1
- import { getMyTenants } from '@core/sdk/client'
1
+ import { getMyActiveTenant, getMyTenants } from '@core/sdk/client'
2
2
 
3
3
  import { useLocalePath } from '#i18n'
4
4
 
@@ -11,8 +11,11 @@ export default defineNuxtRouteMiddleware(async () => {
11
11
 
12
12
  const localePath = useLocalePath()
13
13
 
14
- const response = await getMyTenants({ composable: '$fetch' }).catch(() => null)
15
- const tenants = response?.tenants ?? []
14
+ const [tenantsResponse, activeTenant] = await Promise.all([
15
+ getMyTenants({ composable: '$fetch' }).catch(() => null),
16
+ getMyActiveTenant({ composable: '$fetch' }).catch(() => null),
17
+ ])
18
+ const tenants = tenantsResponse?.tenants ?? []
16
19
  if (!tenants.length) {
17
20
  return
18
21
  }
@@ -26,5 +29,8 @@ export default defineNuxtRouteMiddleware(async () => {
26
29
  if (tenants.length === 1) {
27
30
  return navigateTo(localePath(`/${tenants[0].id}/service/openai`), { replace: true })
28
31
  }
32
+ if (activeTenant && tenants.some(tenant => tenant.id === activeTenant.id)) {
33
+ return navigateTo(localePath(`/${activeTenant.id}/service/openai`), { replace: true })
34
+ }
29
35
  return navigateTo(localePath('/select-tenant'), { replace: true })
30
36
  })
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "license": "AGPL-3.0-or-later",
4
4
  "author": "bbv Software Services AG (https://www.bbv.ch)",
5
5
  "type": "module",
6
- "version": "0.295.2",
6
+ "version": "0.295.4",
7
7
  "description": "Swiss AI Hub - Admin & Management UI (Nuxt 3 layer)",
8
8
  "main": "./nuxt.config.ts",
9
9
  "repository": {