prettier fix
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { getSupabaseServerAdminClient } from "@/packages/supabase/src/clients/server-admin-client";
|
||||
import { AnalysisOrderStatus } from '@/packages/shared/src/types/medipost-analysis';
|
||||
import { getSupabaseServerAdminClient } from '@/packages/supabase/src/clients/server-admin-client';
|
||||
|
||||
import type { AnalysisResponseElement } from "../types/analysis-response-element";
|
||||
import type { AnalysisResponseElement } from '../types/analysis-response-element';
|
||||
|
||||
export async function getExistingAnalysisResponseElements({
|
||||
analysisResponseId,
|
||||
@@ -26,20 +26,17 @@ export async function upsertAnalysisResponseElement({
|
||||
const { data } = await getSupabaseServerAdminClient()
|
||||
.schema('medreport')
|
||||
.from('analysis_response_elements')
|
||||
.upsert(
|
||||
element,
|
||||
{
|
||||
onConflict: 'analysis_response_id,analysis_element_original_id',
|
||||
ignoreDuplicates: false
|
||||
}
|
||||
)
|
||||
.upsert(element, {
|
||||
onConflict: 'analysis_response_id,analysis_element_original_id',
|
||||
ignoreDuplicates: false,
|
||||
})
|
||||
.select('id')
|
||||
.throwOnError();
|
||||
|
||||
const analysisResponseElementId = data?.[0]?.id;
|
||||
if (!analysisResponseElementId) {
|
||||
throw new Error(
|
||||
`Failed to insert or update analysis response element (response id: ${element.analysis_response_id}, element id: ${element.analysis_element_original_id})`
|
||||
`Failed to insert or update analysis response element (response id: ${element.analysis_response_id}, element id: ${element.analysis_element_original_id})`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -54,7 +51,7 @@ export async function upsertAnalysisResponse({
|
||||
}: {
|
||||
analysisOrderId: number;
|
||||
orderNumber: string;
|
||||
orderStatus: typeof AnalysisOrderStatus[keyof typeof AnalysisOrderStatus];
|
||||
orderStatus: (typeof AnalysisOrderStatus)[keyof typeof AnalysisOrderStatus];
|
||||
userId: string;
|
||||
}) {
|
||||
const { data: analysisResponse } = await getSupabaseServerAdminClient()
|
||||
@@ -72,7 +69,6 @@ export async function upsertAnalysisResponse({
|
||||
.select('id')
|
||||
.throwOnError();
|
||||
|
||||
|
||||
const analysisResponseId = analysisResponse?.[0]?.id;
|
||||
if (!analysisResponseId) {
|
||||
throw new Error(
|
||||
|
||||
Reference in New Issue
Block a user