Fix bug that lost photos when updating activities and work items

This commit is contained in:
John Lyon-Smith
2018-05-15 09:37:14 -07:00
parent 609bb1c3d5
commit 77ed56ddf5
3 changed files with 4 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ export let activitySchema = new Schema(
notes: { type: String, required: true },
fromStreetNumber: Number,
toStreetNumber: Number,
photos: [Schema.Types.ObjectId],
photos: { type: [Schema.Types.ObjectId], default: undefined },
},
{ timestamps: true, id: false }
)

View File

@@ -17,7 +17,7 @@ export const workItemSchema = new Schema(
coordinates: [Number],
},
address: String,
photos: [{ type: Schema.Types.ObjectId }],
photos: [{ type: Schema.Types.ObjectId, default: undefined }],
details: String,
ticketNumber: { type: Number, default: 0 },
},