diff --git a/lib/actions.ts b/lib/actions.ts index a560b42..df4b0df 100644 --- a/lib/actions.ts +++ b/lib/actions.ts @@ -128,7 +128,7 @@ export async function assignReportToCase(reportId: string, caseId?: string) { .collection("safety_reports") .updateOne( { _id: reportId }, - caseId + (caseId ? { $set, } @@ -136,7 +136,7 @@ export async function assignReportToCase(reportId: string, caseId?: string) { $unset: { case_id: 1, }, - } + }) as never // fuck you ); return $set;