diff --git a/__tests__/unit/models/platform.model.test.ts b/__tests__/unit/models/platform.model.test.ts index a400908..e339f54 100644 --- a/__tests__/unit/models/platform.model.test.ts +++ b/__tests__/unit/models/platform.model.test.ts @@ -45,7 +45,13 @@ describe('Platform model', () => { // const module2 = new Module({ // name: 'hivemind', // community: community._id, - // options: { platforms: [{ platform: new Types.ObjectId() }, { platform: platform._id }, { platform: new Types.ObjectId() }] }, + // options: { + // platforms: [ + // { platform: new Types.ObjectId() }, + // { platform: platform._id }, + // { platform: new Types.ObjectId() }, + // ], + // }, // }); // await module2.save(); @@ -82,18 +88,18 @@ describe('Platform model', () => { // if (communityDoc?.platforms && communityDoc?.roles) { // const idAsString = platform.id.toHexString ? platform.id.toHexString() : platform.id; // expect(communityDoc.platforms[0].toHexString()).toBe(idAsString); - // expect(JSON.parse(JSON.stringify(communityDoc.roles))).toEqual([ - // { - // _id: expect.anything(), - // roleType: 'admin', - // source: { - // platform: 'discord', - // identifierType: 'member', - // identifierValues: [user.discordId], - // platformId: platform._id.toHexString(), - // }, - // }, - // ]); + // // expect(JSON.parse(JSON.stringify(communityDoc.roles))).toEqual([ + // // { + // // _id: expect.anything(), + // // roleType: 'admin', + // // source: { + // // platform: 'discord', + // // identifierType: 'member', + // // identifierValues: [user.discordId], + // // platformId: platform._id.toHexString(), + // // }, + // // }, + // // ]); // } // }); // }); diff --git a/package.json b/package.json index 5fff4e2..1dd6c98 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@togethercrew.dev/db", - "version": "3.0.50", + "version": "3.0.51", "description": "All interactions with DB", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/models/schemas/Platform.schema.ts b/src/models/schemas/Platform.schema.ts index 5fa1a76..0d6e4d2 100644 --- a/src/models/schemas/Platform.schema.ts +++ b/src/models/schemas/Platform.schema.ts @@ -95,19 +95,19 @@ platformSchema.post('save', async function () { { $addToSet: { platforms: platform._id, - roles: { - $each: [ - { - roleType: 'admin', - source: { - platform: 'discord', - identifierType: 'member', - identifierValues: [user.discordId], - platformId: platform._id, - }, - }, - ], - }, + // roles: { + // $each: [ + // { + // roleType: 'admin', + // source: { + // platform: 'discord', + // identifierType: 'member', + // identifierValues: [user.discordId], + // platformId: platform._id, + // }, + // }, + // ], + // }, }, }, );