Full Visualization Page API completed
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user