diff --git a/ui/src/views/CompanyEditView.vue b/ui/src/views/CompanyEditView.vue index 02138e2..d31a1f3 100644 --- a/ui/src/views/CompanyEditView.vue +++ b/ui/src/views/CompanyEditView.vue @@ -223,7 +223,11 @@ onMounted(async () => { { title: t('company.title'), to: '/id/company' }, { title: t('company.new') }, ]) - const check = await api.get('rest/service/id/company/Ligoj') + // Check if API is available. Use a list probe (rows=1) so the check doesn't + // depend on a specific hardcoded entity that may or may not exist in the + // real LDAP backend. The list endpoint returns 200 with an empty array when + // nothing matches, and `code` is only set on real API errors. + const check = await api.get('rest/service/id/company?rows=1&page=1') if (!check || check.code) { demoMode.value = true errorStore.clear() diff --git a/ui/src/views/GroupEditView.vue b/ui/src/views/GroupEditView.vue index a660fcf..d728e2a 100644 --- a/ui/src/views/GroupEditView.vue +++ b/ui/src/views/GroupEditView.vue @@ -168,7 +168,11 @@ onMounted(async () => { { title: t('group.title'), to: '/id/group' }, { title: t('group.new') }, ]) - const check = await api.get('rest/service/id/group/Engineering') + // Check if API is available. Use a list probe (rows=1) so the check doesn't + // depend on a specific hardcoded entity that may or may not exist in the + // real LDAP backend. The list endpoint returns 200 with an empty array when + // nothing matches, and `code` is only set on real API errors. + const check = await api.get('rest/service/id/group?rows=1&page=1') if (!check || check.code) { demoMode.value = true errorStore.clear() diff --git a/ui/src/views/UserEditView.vue b/ui/src/views/UserEditView.vue index 48424ec..5966d68 100644 --- a/ui/src/views/UserEditView.vue +++ b/ui/src/views/UserEditView.vue @@ -400,8 +400,11 @@ onMounted(async () => { { title: t('user.title'), to: '/id/user' }, { title: t('user.new') }, ]) - // Check if API is available - const check = await api.get('rest/service/id/user/admin') + // Check if API is available. Use a list probe (rows=1) so the check doesn't + // depend on a specific hardcoded entity that may or may not exist in the + // real LDAP backend. The list endpoint returns 200 with an empty array when + // nothing matches, and `code` is only set on real API errors. + const check = await api.get('rest/service/id/user?rows=1&page=1') if (!check || check.code) { demoMode.value = true errorStore.clear()