Full Visualization Page API completed

This commit is contained in:
2025-03-31 18:30:14 +05:30
parent 10ece17128
commit 9456cbcbbe
18 changed files with 610 additions and 237 deletions

View File

@@ -158,7 +158,21 @@ export class pointService {
modelfileID: modelfileID,
})
.select("-_id -__v -createdAt -updatedAt");
res.send(getData);
if (!getData) {
return res.json({ message: "Data not found" });
}
const formattedData = {
modelfileID: getData?.modelfileID,
type: getData?.type,
points: Array.isArray(getData?.points)
? getData.points.map((point: any) => ({
position: point.position,
rotation: point.rotation,
}))
: [],
};
return res.status(200).json(formattedData);
} catch (error) {
res.status(500).json({ message: "Server error", error });
}