add medreport schema
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
'use server'
|
||||
|
||||
'use server';
|
||||
|
||||
import logRequestResult from '@/lib/services/audit.service';
|
||||
import { RequestStatus } from '@/lib/types/audit';
|
||||
import {
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
ConnectedOnlineMethodName,
|
||||
} from '@/lib/types/connected-online';
|
||||
import { ExternalApi } from '@/lib/types/external';
|
||||
import { Tables } from '@/supabase/database.types';
|
||||
import { Tables } from '@/packages/supabase/src/database.types';
|
||||
import { createClient } from '@/utils/supabase/server';
|
||||
import axios from 'axios';
|
||||
|
||||
@@ -106,11 +106,13 @@ export async function bookAppointment(
|
||||
{ data: dbService, error: serviceError },
|
||||
] = await Promise.all([
|
||||
supabase
|
||||
.schema('medreport')
|
||||
.from('connected_online_providers')
|
||||
.select('*')
|
||||
.eq('id', clinicId)
|
||||
.limit(1),
|
||||
supabase
|
||||
.schema('medreport')
|
||||
.from('connected_online_services')
|
||||
.select('*')
|
||||
.eq('sync_id', serviceSyncId)
|
||||
@@ -132,8 +134,14 @@ export async function bookAppointment(
|
||||
);
|
||||
}
|
||||
|
||||
const clinic: Tables<'connected_online_providers'> = dbClinic![0];
|
||||
const service: Tables<'connected_online_services'> = dbService![0];
|
||||
const clinic: Tables<
|
||||
{ schema: 'medreport' },
|
||||
'connected_online_providers'
|
||||
> = dbClinic![0];
|
||||
const service: Tables<
|
||||
{ schema: 'medreport' },
|
||||
'connected_online_services'
|
||||
> = dbService![0];
|
||||
|
||||
// TODO the dummy data needs to be replaced with real values once they're present on the user/account
|
||||
const response = await axios.post(
|
||||
@@ -183,6 +191,7 @@ export async function bookAppointment(
|
||||
const responseParts = responseData.Value.split(',');
|
||||
|
||||
const { error } = await supabase
|
||||
.schema('medreport')
|
||||
.from('connected_online_reservation')
|
||||
.insert({
|
||||
booking_code: responseParts[1],
|
||||
|
||||
Reference in New Issue
Block a user