bug fix in adding models that dont have eventData
This commit is contained in:
@@ -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,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user