@bluedot-innovation/models 2.0.0-beta.2 → 2.0.0-beta.3
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/models/Project.js +3 -0
- package/package.json +1 -1
package/models/Project.js
CHANGED
|
@@ -8,6 +8,7 @@ let mongoose = require('mongoose')
|
|
|
8
8
|
let Schema = mongoose.Schema
|
|
9
9
|
let StateEnum = require('@bluedot-innovation/enums').StateEnum
|
|
10
10
|
let uuidv4 = require('uuid/v4')
|
|
11
|
+
let patcher = require('mongoose-json-patch')
|
|
11
12
|
|
|
12
13
|
let WebhookSchema = require('../schemas/Webhook')
|
|
13
14
|
|
|
@@ -33,6 +34,8 @@ let ProjectSchema = new mongoose.Schema({
|
|
|
33
34
|
},
|
|
34
35
|
{collection: 'application'})
|
|
35
36
|
|
|
37
|
+
ProjectSchema.plugin(patcher)
|
|
38
|
+
|
|
36
39
|
function validateUUIDv4 (id) {
|
|
37
40
|
const expression = '^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$'
|
|
38
41
|
const regex = new RegExp(expression, 'i')
|