fix: show proper error if server down in self-hosting

This commit is contained in:
prafull-opensignlabs
2024-09-25 21:01:17 +05:30
parent a4d1df8324
commit 6ea254d9ac
10 changed files with 111 additions and 88 deletions
@@ -51,7 +51,10 @@ export default async function UpdateExistUserAsAdmin(request) {
extClsQuery.notEqualTo('IsDisabled', true);
const extAdminRes = await extClsQuery.find({ useMasterKey: true });
if (extAdminRes && extAdminRes.length === 1 && extAdminRes?.[0]?.get('OrganizationId')) {
throw new Parse.Error(Parse.Error.DUPLICATE_VALUE, 'Admin already exist.');
throw new Parse.Error(
Parse.Error.DUPLICATE_VALUE,
'Admin already exists. Please login to the application using admin credentials in order to manage users.'
);
} else {
const extCls = new Parse.Query('contracts_Users');
extCls.equalTo('Email', email);