add medreport schema
This commit is contained in:
@@ -22,6 +22,7 @@ export const updateTeamAccountName = enhanceAction(
|
||||
logger.info(ctx, `Updating team name...`);
|
||||
|
||||
const { error, data } = await client
|
||||
.schema('medreport')
|
||||
.from('accounts')
|
||||
.update({
|
||||
name,
|
||||
|
||||
@@ -41,6 +41,7 @@ export const createInvitationsAction = enhanceAction(
|
||||
);
|
||||
|
||||
const { data: company, error: companyError } = await client
|
||||
.schema('medreport')
|
||||
.from('accounts')
|
||||
.select('id')
|
||||
.eq('slug', accountSlug);
|
||||
|
||||
@@ -79,9 +79,11 @@ export const transferOwnershipAction = enhanceAction(
|
||||
logger.info(ctx, 'Processing team ownership transfer request...');
|
||||
|
||||
// assert that the user is the owner of the account
|
||||
const { data: isOwner, error } = await client.rpc('is_account_owner', {
|
||||
account_id: data.accountId,
|
||||
});
|
||||
const { data: isOwner, error } = await client
|
||||
.schema('medreport')
|
||||
.rpc('is_account_owner', {
|
||||
account_id: data.accountId,
|
||||
});
|
||||
|
||||
if (error || !isOwner) {
|
||||
logger.error(ctx, 'User is not the owner of this account');
|
||||
|
||||
Reference in New Issue
Block a user