improvement: tasks and cases feature updated based on the new prosthesis types and their steps. the whole assignment proccess removed from the flow.
This commit is contained in:
11
backend/src/modules/cases/lab-case-task.util.ts
Normal file
11
backend/src/modules/cases/lab-case-task.util.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Prisma } from '@prisma/client';
|
||||
|
||||
/** Normalize the JSON `teeth` column of a lab case task into a clean string[]. */
|
||||
export function normalizeTaskTeeth(value: Prisma.JsonValue | null | undefined): string[] {
|
||||
if (!Array.isArray(value)) {
|
||||
return [];
|
||||
}
|
||||
return value
|
||||
.filter((v): v is string | number => typeof v === 'string' || typeof v === 'number')
|
||||
.map((v) => String(v));
|
||||
}
|
||||
Reference in New Issue
Block a user