@justair/justair-library 4.8.48 → 4.8.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justair/justair-library",
3
- "version": "4.8.48",
3
+ "version": "4.8.50",
4
4
  "description": "JustAir Internal Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -230,8 +230,19 @@ const monitorsSchema = mongoose.Schema(
230
230
  monitorLatitude: Number,
231
231
  monitorLongitude: Number,
232
232
  gpsLocation: {
233
- type: { type: String, enum: ["Point"], required: true },
234
- coordinates: { type: [Number], required: true },
233
+ type: {
234
+ type: String,
235
+ enum: ["Point"],
236
+ required: function () {
237
+ return this.monitorLatitude != null && this.monitorLongitude != null;
238
+ },
239
+ },
240
+ coordinates: {
241
+ type: [Number],
242
+ required: function () {
243
+ return this.monitorLatitude != null && this.monitorLongitude != null;
244
+ },
245
+ },
235
246
  },
236
247
  location: Object,
237
248
  context: [String],