add medreport schema
This commit is contained in:
@@ -15,13 +15,13 @@ import {
|
||||
ImpersonateUserSchema,
|
||||
ReactivateUserSchema,
|
||||
} from './schema/admin-actions.schema';
|
||||
import { CreateCompanySchema } from './schema/create-company.schema';
|
||||
import { CreateUserSchema } from './schema/create-user.schema';
|
||||
import { ResetPasswordSchema } from './schema/reset-password.schema';
|
||||
import { createAdminAccountsService } from './services/admin-accounts.service';
|
||||
import { createAdminAuthUserService } from './services/admin-auth-user.service';
|
||||
import { adminAction } from './utils/admin-action';
|
||||
import { CreateCompanySchema } from './schema/create-company.schema';
|
||||
import { createCreateCompanyAccountService } from './services/admin-create-company-account.service';
|
||||
import { adminAction } from './utils/admin-action';
|
||||
|
||||
/**
|
||||
* @name banUserAction
|
||||
@@ -183,12 +183,16 @@ export const createUserAction = adminAction(
|
||||
);
|
||||
|
||||
const { error: accountError } = await adminClient
|
||||
.schema('medreport')
|
||||
.from('accounts')
|
||||
.update({ personal_code: personalCode })
|
||||
.eq('id', data.user.id);
|
||||
|
||||
if (accountError) {
|
||||
logger.error({ accountError }, 'Error inserting personal code to accounts');
|
||||
logger.error(
|
||||
{ accountError },
|
||||
'Error inserting personal code to accounts',
|
||||
);
|
||||
throw new Error(`Error saving personal code: ${accountError.message}`);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ class AdminAccountsService {
|
||||
|
||||
async deleteAccount(accountId: string) {
|
||||
const { error } = await this.adminClient
|
||||
.schema('medreport')
|
||||
.from('accounts')
|
||||
.delete()
|
||||
.eq('id', accountId);
|
||||
|
||||
@@ -30,6 +30,7 @@ export class AdminDashboardService {
|
||||
};
|
||||
|
||||
const subscriptionsPromise = this.client
|
||||
.schema('medreport')
|
||||
.from('subscriptions')
|
||||
.select('*', selectParams)
|
||||
.eq('status', 'active')
|
||||
@@ -47,6 +48,7 @@ export class AdminDashboardService {
|
||||
});
|
||||
|
||||
const trialsPromise = this.client
|
||||
.schema('medreport')
|
||||
.from('subscriptions')
|
||||
.select('*', selectParams)
|
||||
.eq('status', 'trialing')
|
||||
@@ -64,6 +66,7 @@ export class AdminDashboardService {
|
||||
});
|
||||
|
||||
const accountsPromise = this.client
|
||||
.schema('medreport')
|
||||
.from('accounts')
|
||||
.select('*', selectParams)
|
||||
.eq('is_personal_account', true)
|
||||
@@ -81,6 +84,7 @@ export class AdminDashboardService {
|
||||
});
|
||||
|
||||
const teamAccountsPromise = this.client
|
||||
.schema('medreport')
|
||||
.from('accounts')
|
||||
.select('*', selectParams)
|
||||
.eq('is_personal_account', false)
|
||||
|
||||
Reference in New Issue
Block a user