Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ui/src/views/CompanyEditView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 5 additions & 1 deletion ui/src/views/GroupEditView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 5 additions & 2 deletions ui/src/views/UserEditView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading