add medreport schema
This commit is contained in:
@@ -17,6 +17,7 @@ class AccountsApi {
|
||||
*/
|
||||
async getAccount(id: string) {
|
||||
const { data, error } = await this.client
|
||||
.schema('medreport')
|
||||
.from('accounts')
|
||||
.select('*')
|
||||
.eq('id', id)
|
||||
@@ -35,6 +36,7 @@ class AccountsApi {
|
||||
*/
|
||||
async getAccountWorkspace() {
|
||||
const { data, error } = await this.client
|
||||
.schema('medreport')
|
||||
.from('user_account_workspace')
|
||||
.select(`*`)
|
||||
.single();
|
||||
@@ -63,6 +65,7 @@ class AccountsApi {
|
||||
const { user } = data;
|
||||
|
||||
const { data: accounts, error } = await this.client
|
||||
.schema('medreport')
|
||||
.from('accounts_memberships')
|
||||
.select(
|
||||
`
|
||||
@@ -91,6 +94,7 @@ class AccountsApi {
|
||||
|
||||
async loadTempUserAccounts() {
|
||||
const { data: accounts, error } = await this.client
|
||||
.schema('medreport')
|
||||
.from('user_accounts')
|
||||
.select(`name, slug`);
|
||||
|
||||
@@ -131,6 +135,7 @@ class AccountsApi {
|
||||
*/
|
||||
async getOrder(accountId: string) {
|
||||
const response = await this.client
|
||||
.schema('medreport')
|
||||
.from('orders')
|
||||
.select('*, items: order_items !inner (*)')
|
||||
.eq('account_id', accountId)
|
||||
@@ -151,6 +156,7 @@ class AccountsApi {
|
||||
*/
|
||||
async getCustomerId(accountId: string) {
|
||||
const response = await this.client
|
||||
.schema('medreport')
|
||||
.from('billing_customers')
|
||||
.select('customer_id')
|
||||
.eq('account_id', accountId)
|
||||
|
||||
Reference in New Issue
Block a user