feat(MED-87): update status on results

This commit is contained in:
2025-08-11 10:41:01 +03:00
parent d582e222ce
commit 63b86c0abb
8 changed files with 87 additions and 17 deletions

View File

@@ -45,7 +45,8 @@ export async function updateOrder({
orderId: number;
orderStatus: Tables<{ schema: 'medreport' }, 'analysis_orders'>['status'];
}) {
const { error } = await getSupabaseServerClient()
console.info(`Updating order id=${orderId} status=${orderStatus}`);
await getSupabaseServerAdminClient()
.schema('medreport')
.from('analysis_orders')
.update({
@@ -53,9 +54,6 @@ export async function updateOrder({
})
.eq('id', orderId)
.throwOnError();
if (error) {
throw new Error(`Failed to update order, message=${error}, data=${JSON.stringify(error)}`);
}
}
export async function getOrder({