prettier fix
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
'use server';
|
||||
|
||||
import type { Message } from '@/lib/types/medipost';
|
||||
|
||||
import { getSupabaseServerAdminClient } from '@/packages/supabase/src/clients/server-admin-client';
|
||||
|
||||
export async function getLatestMessage({
|
||||
@@ -15,14 +14,17 @@ export async function getLatestMessage({
|
||||
return null;
|
||||
}
|
||||
|
||||
const filtered = messages.filter(({ messageId }) => !excludedMessageIds?.includes(messageId));
|
||||
const filtered = messages.filter(
|
||||
({ messageId }) => !excludedMessageIds?.includes(messageId),
|
||||
);
|
||||
|
||||
if (!filtered.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return filtered.reduce((prev, current) =>
|
||||
Number(prev.messageId) > Number(current.messageId) ? prev : current,
|
||||
return filtered.reduce(
|
||||
(prev, current) =>
|
||||
Number(prev.messageId) > Number(current.messageId) ? prev : current,
|
||||
{ messageId: '' } as Message,
|
||||
);
|
||||
}
|
||||
@@ -38,9 +40,9 @@ export async function upsertMedipostActionLog({
|
||||
medipostPrivateMessageId,
|
||||
}: {
|
||||
action:
|
||||
| 'send_order_to_medipost'
|
||||
| 'sync_analysis_results_from_medipost'
|
||||
| 'send_fake_analysis_results_to_medipost';
|
||||
| 'send_order_to_medipost'
|
||||
| 'sync_analysis_results_from_medipost'
|
||||
| 'send_fake_analysis_results_to_medipost';
|
||||
xml: string;
|
||||
hasAnalysisResults?: boolean;
|
||||
medusaOrderId?: string | null;
|
||||
@@ -63,10 +65,10 @@ export async function upsertMedipostActionLog({
|
||||
medipost_external_order_id: medipostExternalOrderId,
|
||||
medipost_private_message_id: medipostPrivateMessageId,
|
||||
},
|
||||
{
|
||||
onConflict: 'medipost_private_message_id',
|
||||
ignoreDuplicates: false
|
||||
}
|
||||
{
|
||||
onConflict: 'medipost_private_message_id',
|
||||
ignoreDuplicates: false,
|
||||
},
|
||||
)
|
||||
.select('id')
|
||||
.throwOnError();
|
||||
@@ -74,7 +76,7 @@ export async function upsertMedipostActionLog({
|
||||
const medipostActionId = data?.[0]?.id;
|
||||
if (!medipostActionId) {
|
||||
throw new Error(
|
||||
`Failed to insert or update medipost action (private message id: ${medipostPrivateMessageId})`
|
||||
`Failed to insert or update medipost action (private message id: ${medipostPrivateMessageId})`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user