@@ -14,6 +14,9 @@ export default async function AdminAssemblyDetailPage({
|
||||
where: { id: assemblyId, projectId: id },
|
||||
include: {
|
||||
project: { select: { id: true, code: true, name: true } },
|
||||
stepFile: true,
|
||||
drawingFile: true,
|
||||
cutFile: true,
|
||||
parts: {
|
||||
orderBy: { code: "asc" },
|
||||
include: {
|
||||
@@ -28,6 +31,17 @@ export default async function AdminAssemblyDetailPage({
|
||||
});
|
||||
if (!assembly) notFound();
|
||||
|
||||
const fileView = (f: typeof assembly.stepFile) =>
|
||||
f
|
||||
? {
|
||||
id: f.id,
|
||||
originalName: f.originalName,
|
||||
sizeBytes: f.sizeBytes,
|
||||
kind: f.kind,
|
||||
mimeType: f.mimeType,
|
||||
}
|
||||
: null;
|
||||
|
||||
return (
|
||||
<AssemblyDetailClient
|
||||
project={assembly.project}
|
||||
@@ -37,6 +51,9 @@ export default async function AdminAssemblyDetailPage({
|
||||
name: assembly.name,
|
||||
qty: assembly.qty,
|
||||
notes: assembly.notes,
|
||||
stepFile: fileView(assembly.stepFile),
|
||||
drawingFile: fileView(assembly.drawingFile),
|
||||
cutFile: fileView(assembly.cutFile),
|
||||
}}
|
||||
parts={assembly.parts.map((p) => ({
|
||||
id: p.id,
|
||||
|
||||
Reference in New Issue
Block a user