merged with main branch to clear the testing commits
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
||||
interface setAssetInput {
|
||||
modelUuid: string;
|
||||
modelName: string;
|
||||
position: []; // user ID
|
||||
position: [];
|
||||
rotation: object;
|
||||
eventData: Mixed;
|
||||
modelfileID: string;
|
||||
@@ -22,7 +22,7 @@ interface setAssetInput {
|
||||
interface AssetUpdate {
|
||||
modelUuid: string;
|
||||
modelName: string;
|
||||
position: []; // user ID
|
||||
position: [];
|
||||
rotation: object;
|
||||
isLocked: boolean;
|
||||
isVisible: boolean;
|
||||
@@ -98,12 +98,7 @@ export const setAssetModel = async (
|
||||
},
|
||||
{ new: true }
|
||||
);
|
||||
// return {
|
||||
// success: true,
|
||||
// message: "Model updated successfully",
|
||||
// data: updatevalue,
|
||||
// organization: organization,
|
||||
// };
|
||||
|
||||
return {
|
||||
status: "Updated successfully",
|
||||
data: updatevalue,
|
||||
@@ -121,21 +116,6 @@ export const setAssetModel = async (
|
||||
isVisible,
|
||||
};
|
||||
|
||||
// if (eventData) {
|
||||
// if (eventData?.type === "Conveyor") {
|
||||
// assetData.eventData = {
|
||||
// type: eventData.type,
|
||||
// // point:undefined,
|
||||
// points: eventData.points,
|
||||
// };
|
||||
// } else {
|
||||
// assetData.eventData = {
|
||||
// type: eventData.type,
|
||||
// point: eventData.point,
|
||||
// // points: undefined
|
||||
// };
|
||||
// }
|
||||
// }
|
||||
if (eventData) {
|
||||
const typedEventData = eventData as unknown as {
|
||||
type: string;
|
||||
@@ -254,12 +234,7 @@ export const setAssetModel = async (
|
||||
isVisible: assetDoc.isVisible,
|
||||
};
|
||||
}
|
||||
// return {
|
||||
// success: true,
|
||||
// message: "Model created successfully",
|
||||
// data: assetDatas,
|
||||
// organization: organization,
|
||||
// };
|
||||
|
||||
return {
|
||||
status: "Success",
|
||||
data: assetDatas,
|
||||
@@ -307,11 +282,6 @@ export const deleteAssetModel = async (
|
||||
{ new: true }
|
||||
);
|
||||
if (!archivedAsset) {
|
||||
// return {
|
||||
// success: false,
|
||||
// status: "Failed to archive asset",
|
||||
// organization: organization,
|
||||
// };
|
||||
return {
|
||||
status: "Failed to archive asset",
|
||||
};
|
||||
@@ -321,13 +291,6 @@ export const deleteAssetModel = async (
|
||||
{ $set: { isArchive: true } }
|
||||
);
|
||||
|
||||
// return {
|
||||
// success: true,
|
||||
// message: "Model deleted successfully",
|
||||
// data: archivedAsset,
|
||||
// organization: organization,
|
||||
// };
|
||||
|
||||
return {
|
||||
status: "Success",
|
||||
data: archivedAsset,
|
||||
@@ -364,11 +327,6 @@ export const replaceEventDatas = async (
|
||||
});
|
||||
if (!existingModel) {
|
||||
return { status: "Model not for this UUID" };
|
||||
// return {
|
||||
// success: false,
|
||||
// message: "Model not for this UUID",
|
||||
// organization: organization,
|
||||
// };
|
||||
} else {
|
||||
const typedEventData = eventData as unknown as {
|
||||
speed: number;
|
||||
@@ -384,23 +342,11 @@ export const replaceEventDatas = async (
|
||||
{ modelUuid, projectId, isArchive: false },
|
||||
{
|
||||
points: typedEventData?.points,
|
||||
// speed: speed,
|
||||
type: typedEventData?.type || existingModel?.type,
|
||||
},
|
||||
{ new: true }
|
||||
);
|
||||
|
||||
// if (updatedModel)
|
||||
// // return {
|
||||
// // success: true,
|
||||
// // message: "Data updated successfully",
|
||||
// // data: updatedModel,
|
||||
// // organization: organization,
|
||||
// // };
|
||||
// return {
|
||||
// status: "Success",
|
||||
// data: updatedModel,
|
||||
// };
|
||||
return {
|
||||
status: "Success",
|
||||
data: updatedModel,
|
||||
@@ -448,7 +394,6 @@ export const updateAssetPositionRotation = async (
|
||||
});
|
||||
if (!existingAsset) {
|
||||
return { status: "Asset not found" };
|
||||
// return res.send("Asset not found");
|
||||
}
|
||||
const updateAsset = await assetModel(organization).updateMany(
|
||||
{
|
||||
@@ -464,12 +409,10 @@ export const updateAssetPositionRotation = async (
|
||||
isLocked: isLocked,
|
||||
}
|
||||
);
|
||||
// if (updateAsset)
|
||||
return {
|
||||
status: "Success",
|
||||
data: updateAsset,
|
||||
};
|
||||
// return res.status(200).json({ message: "Asset updated successfully" });
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof Error) {
|
||||
return {
|
||||
@@ -501,7 +444,6 @@ export const getFloorItems = async (
|
||||
|
||||
if (!findValues || findValues.length === 0) {
|
||||
return { status: "floorItems not found" };
|
||||
// return res.status(200).json({ message: "floorItems not found" });
|
||||
}
|
||||
|
||||
const response = findValues.map((item) => {
|
||||
@@ -519,8 +461,6 @@ export const getFloorItems = async (
|
||||
return responseItem;
|
||||
});
|
||||
|
||||
// return res.status(200).json(response);
|
||||
|
||||
return {
|
||||
status: "Success",
|
||||
data: response,
|
||||
|
||||
Reference in New Issue
Block a user