API creation for Product EventDatas and updating asset files
This commit is contained in:
@@ -10,21 +10,21 @@
|
||||
// try {
|
||||
// const {
|
||||
// productName,
|
||||
// modeluuid,
|
||||
// modelname,
|
||||
// modelUuid,
|
||||
// modelName,
|
||||
// eventData,
|
||||
// organization,
|
||||
// productID,
|
||||
// } = req.body;
|
||||
|
||||
// // Validate required fields
|
||||
// if (!modeluuid || !modelname || !organization) {
|
||||
// if (!modelUuid || !modelName || !organization) {
|
||||
// return res.status(400).json({ message: "Missing required fields" });
|
||||
// }
|
||||
|
||||
// // Check if asset exists
|
||||
// const existingAsset = await assetModel(organization).findOne({
|
||||
// modeluuid: modeluuid,
|
||||
// modelUuid: modelUuid,
|
||||
// isArchive: false,
|
||||
// });
|
||||
// if (!existingAsset) {
|
||||
@@ -100,8 +100,8 @@
|
||||
// {
|
||||
// $push: {
|
||||
// ProductData: {
|
||||
// AssetName: modelname,
|
||||
// Assetuuid: modeluuid,
|
||||
// AssetName: modelName,
|
||||
// Assetuuid: modelUuid,
|
||||
// paths: {
|
||||
// Points: pointRefs,
|
||||
// },
|
||||
@@ -118,8 +118,8 @@
|
||||
// productName: productName,
|
||||
// ProductData: [
|
||||
// {
|
||||
// AssetName: modelname,
|
||||
// Assetuuid: modeluuid,
|
||||
// AssetName: modelName,
|
||||
// Assetuuid: modelUuid,
|
||||
// paths: {
|
||||
// Points: pointRefs,
|
||||
// },
|
||||
@@ -191,11 +191,11 @@
|
||||
// }
|
||||
// // static async deleteFloorItems(req: Request, res: Response): Promise<any> {
|
||||
// // try {
|
||||
// // const { modeluuid, modelname, organization } = req.body;
|
||||
// // const { modelUuid, modelName, organization } = req.body;
|
||||
|
||||
// // const findValue = await assetModel(organization).findOneAndDelete({
|
||||
// // modeluuid: modeluuid,
|
||||
// // modelname: modelname,
|
||||
// // modelUuid: modelUuid,
|
||||
// // modelName: modelName,
|
||||
// // isArchive: false,
|
||||
// // });
|
||||
// // if (!findValue) {
|
||||
@@ -214,8 +214,8 @@
|
||||
// // ): Promise<any> {
|
||||
// // try {
|
||||
// // const {
|
||||
// // modeluuid,
|
||||
// // modelname,
|
||||
// // modelUuid,
|
||||
// // modelName,
|
||||
// // position,
|
||||
// // modelfileID,
|
||||
// // rotation,
|
||||
@@ -226,12 +226,12 @@
|
||||
// // } = req.body;
|
||||
|
||||
// // const existingAsset = await assetModel(organization).findOne({
|
||||
// // modeluuid: modeluuid,
|
||||
// // modelUuid: modelUuid,
|
||||
// // isArchive: false,
|
||||
// // });
|
||||
// // if (!existingAsset) return res.send("Asset not found");
|
||||
// // const updateAsset = await assetModel(organization).updateMany(
|
||||
// // { modeluuid: modeluuid, modelname: modelname, isArchive: false },
|
||||
// // { modelUuid: modelUuid, modelName: modelName, isArchive: false },
|
||||
// // {
|
||||
// // position: position,
|
||||
// // rotation: rotation,
|
||||
|
||||
Reference in New Issue
Block a user