bug fix in adding models that dont have eventData

This commit is contained in:
2025-05-10 10:34:24 +05:30
parent e7632afad6
commit cb668a6c96
3 changed files with 87 additions and 89 deletions

View File

@@ -1,19 +1,19 @@
import mongoose, { Document, Schema } from "mongoose";
import MainModel from "../../../connect/mongoose.ts";
interface ICommonBase{
interface ICommonBase {
type: string;
}
interface IPointsConveyor extends ICommonBase{
interface IPointsConveyor extends ICommonBase {
points?: {
Uuid:string;
Uuid: string;
position: [number, number, number];
rotation: [number, number, number];
}[];
}
interface IPoint extends ICommonBase{
interface IPoint extends ICommonBase {
point?: {
Uuid:string;
Uuid: string;
position: [number, number, number];
rotation: [number, number, number];
};
@@ -34,10 +34,9 @@ export interface assetData extends Document {
z: number;
};
speed: number | string;
eventData: IPoint|IPointsConveyor
eventData: IPoint | IPointsConveyor;
}
const assetDataSchema: Schema = new Schema({
isArchive: { type: Boolean, default: false },
modelUuid: { type: String },
@@ -56,7 +55,6 @@ const assetDataSchema: Schema = new Schema({
isVisible: { type: Boolean },
eventData: {
type: Schema.Types.Mixed,
required: true,
},
});