@dynamatix/gb-schemas 0.21.9 → 0.21.10

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": "@dynamatix/gb-schemas",
3
- "version": "0.21.9",
3
+ "version": "0.21.10",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -28,7 +28,7 @@ export const encryptObject = (obj, collectionName) => {
28
28
  let encryptedObj = {};
29
29
 
30
30
  for (const key in obj) {
31
- if (key === "_id") {
31
+ if (key === "_id" || mongoose.isValidObjectId(obj[key])) {
32
32
  encryptedObj[key] = obj[key]; // Don't encrypt _id
33
33
  } else {
34
34
  const iv = crypto.randomBytes(IV_LENGTH); // Generate IV