diff --git a/__tests__/unit/models/module.model.test.ts b/__tests__/unit/models/module.model.test.ts index e056a41..97d7ea0 100644 --- a/__tests__/unit/models/module.model.test.ts +++ b/__tests__/unit/models/module.model.test.ts @@ -17,11 +17,11 @@ describe('Module model', () => { options: { platforms: [ { - platform: new Types.ObjectId(), + platform: null, metadata: { selectedChannels: ['c1', 'c2'], }, - name: PlatformNames.Discord, + name: null, }, ], }, diff --git a/package.json b/package.json index 0bf77c6..252311b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@togethercrew.dev/db", - "version": "3.0.71", + "version": "3.0.72", "description": "All interactions with DB", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/interfaces/Module.interface.ts b/src/interfaces/Module.interface.ts index f076ae4..ae9b222 100644 --- a/src/interfaces/Module.interface.ts +++ b/src/interfaces/Module.interface.ts @@ -6,8 +6,8 @@ export interface IModule { community: Types.ObjectId; options?: { platforms: Array<{ - platform: Types.ObjectId; - name: PlatformNames; + platform: Types.ObjectId | null; + name: PlatformNames | null; metadata?: Record; // dynamic object since structure can change }>; }; diff --git a/src/models/schemas/Module.schema.ts b/src/models/schemas/Module.schema.ts index de330e4..7df69af 100644 --- a/src/models/schemas/Module.schema.ts +++ b/src/models/schemas/Module.schema.ts @@ -28,7 +28,7 @@ const moduleSchema = new Schema( }, name: { type: String, - enum: Object.values(PlatformNames), + enum: [...Object.values(PlatformNames), null], default: null, }, },