fix company creation for admin and inviting of new employees
This commit is contained in:
@@ -54,8 +54,9 @@ export const createInvitationsAction = enhanceAction(
|
||||
);
|
||||
}
|
||||
|
||||
const { data: invitations, error: invitationError } =
|
||||
await serviceClient.rpc('get_invitations_with_account_ids', {
|
||||
const { data: invitations, error: invitationError } = await serviceClient
|
||||
.schema('medreport')
|
||||
.rpc('get_invitations_with_account_ids', {
|
||||
company_id: company[0].id,
|
||||
personal_codes: personalCodes,
|
||||
});
|
||||
|
||||
@@ -51,7 +51,10 @@ class AccountInvitationsService {
|
||||
});
|
||||
|
||||
if (error) {
|
||||
logger.error(ctx, `Failed to remove invitation`);
|
||||
logger.error(
|
||||
{ ...ctx, error: error.message },
|
||||
`Failed to remove invitation`,
|
||||
);
|
||||
|
||||
throw error;
|
||||
}
|
||||
@@ -184,7 +187,7 @@ class AccountInvitationsService {
|
||||
|
||||
throw new Error('Account not found');
|
||||
}
|
||||
|
||||
console.log('property', invitations, accountSlug);
|
||||
const response = await this.client
|
||||
.schema('medreport')
|
||||
.rpc('add_invitations_to_account', {
|
||||
|
||||
Reference in New Issue
Block a user