diff --git a/node/src/gql/mutation/me/create-mentor-config.ts b/node/src/gql/mutation/me/create-mentor-config.ts index 670b5a8..d1cf117 100644 --- a/node/src/gql/mutation/me/create-mentor-config.ts +++ b/node/src/gql/mutation/me/create-mentor-config.ts @@ -39,6 +39,7 @@ export const mentorConfigCreateUpdate = { { $set: { subjects: args.mentorConfig.subjects, + lockedToSubjects: args.mentorConfig.lockedToSubjects, publiclyVisible: args.mentorConfig.publiclyVisible, orgPermissions: args.mentorConfig.orgPermissions, mentorType: args.mentorConfig.mentorType, diff --git a/node/src/models/MentorConfig.ts b/node/src/models/MentorConfig.ts index 791b962..bc6edd3 100644 --- a/node/src/models/MentorConfig.ts +++ b/node/src/models/MentorConfig.ts @@ -24,6 +24,7 @@ import { OrgPermissionInputType } from '../gql/mutation/me/mentor-update-privacy export interface MentorConfig extends Document { configId: string; subjects: string[]; + lockedToSubjects: boolean; publiclyVisible: boolean; mentorType: MentorType; orgPermissions: OrgPermissionProps[]; @@ -44,6 +45,7 @@ export const MentorConfigSchema = new Schema( { configId: { type: String, default: '' }, subjects: { type: [String], default: [] }, + lockedToSubjects: { type: Boolean, default: false }, publiclyVisible: { type: Boolean, default: false }, mentorType: { type: String }, orgPermissions: { type: [OrgPermissionSchema], default: [] }, @@ -66,6 +68,7 @@ export const MentorConfigInputType = new GraphQLInputObjectType({ fields: { configId: { type: GraphQLString }, subjects: { type: GraphQLList(GraphQLString) }, + lockedToSubjects: { type: GraphQLBoolean }, publiclyVisible: { type: GraphQLBoolean }, mentorType: { type: GraphQLString }, orgPermissions: { type: GraphQLList(OrgPermissionInputType) }, @@ -88,6 +91,7 @@ export const MentorConfigType = new GraphQLObjectType({ fields: { configId: { type: GraphQLString }, subjects: { type: GraphQLList(GraphQLString) }, + lockedToSubjects: { type: GraphQLBoolean }, publiclyVisible: { type: GraphQLBoolean }, mentorType: { type: GraphQLString }, orgPermissions: { type: GraphQLList(OrgPermissionType) }, diff --git a/node/test/graphql/mutation/me/create-mentor-config.spec.ts b/node/test/graphql/mutation/me/create-mentor-config.spec.ts index 062b679..0c913c0 100644 --- a/node/test/graphql/mutation/me/create-mentor-config.spec.ts +++ b/node/test/graphql/mutation/me/create-mentor-config.spec.ts @@ -65,6 +65,7 @@ describe('Create Mentor Config', () => { mentorConfigCreateUpdate(mentorConfig: $mentorConfig){ configId subjects + lockedToSubjects publiclyVisible orgPermissions { org @@ -88,6 +89,7 @@ describe('Create Mentor Config', () => { mentorConfig: { configId: 'TestConfigId', subjects: ['TestSubject'], + lockedToSubjects: true, publiclyVisible: true, orgPermissions: [ { @@ -121,6 +123,7 @@ describe('Create Mentor Config', () => { fetchMentorConfig(mentorConfigId: $mentorConfigId){ configId subjects + lockedToSubjects publiclyVisible orgPermissions { org @@ -195,5 +198,8 @@ describe('Create Mentor Config', () => { expect( response2.body.data.fetchMentorConfig.recordTimeLimitSeconds ).to.equal(100); + expect(response2.body.data.fetchMentorConfig.lockedToSubjects).to.equal( + true + ); }); });