Skip to content

Commit

Permalink
feat: disable adding inactive organizations
Browse files Browse the repository at this point in the history
Signed-off-by: Svetoslav Borislavov <[email protected]>
  • Loading branch information
SvetBorislavov committed Jan 21, 2025
1 parent d96c83f commit 3619147
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import AppButton from '@renderer/components/ui/AppButton.vue';
import AppModal from '@renderer/components/ui/AppModal.vue';
import AppInput from '@renderer/components/ui/AppInput.vue';
import AppCustomIcon from '@renderer/components/ui/AppCustomIcon.vue';
import { healthCheck } from '@renderer/services/organization';
/* Props */
const props = defineProps<{
Expand Down Expand Up @@ -48,6 +49,12 @@ const handleAdd = async (e: Event) => {
throw new Error('Invalid Server URL');
}
try {
const active = await healthCheck(serverUrl.value);
if (!active) {
throw new Error('Organization does not exist. Please check the server URL');
}
const organization = await addOrganization({
nickname: nickname.value.trim() || `Organization ${user.organizations.length + 1}`,
serverUrl: serverUrl.value,
Expand Down

0 comments on commit 3619147

Please sign in to comment.