Skip to content

Commit

Permalink
lockedToSubjects to mentorConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronshiel committed Feb 8, 2024
1 parent 985a9f1 commit 94eabff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions node/src/gql/mutation/me/create-mentor-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions node/src/models/MentorConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand All @@ -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: [] },
Expand All @@ -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) },
Expand All @@ -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) },
Expand Down
6 changes: 6 additions & 0 deletions node/test/graphql/mutation/me/create-mentor-config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ describe('Create Mentor Config', () => {
mentorConfigCreateUpdate(mentorConfig: $mentorConfig){
configId
subjects
lockedToSubjects
publiclyVisible
orgPermissions {
org
Expand All @@ -88,6 +89,7 @@ describe('Create Mentor Config', () => {
mentorConfig: {
configId: 'TestConfigId',
subjects: ['TestSubject'],
lockedToSubjects: true,
publiclyVisible: true,
orgPermissions: [
{
Expand Down Expand Up @@ -121,6 +123,7 @@ describe('Create Mentor Config', () => {
fetchMentorConfig(mentorConfigId: $mentorConfigId){
configId
subjects
lockedToSubjects
publiclyVisible
orgPermissions {
org
Expand Down Expand Up @@ -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
);
});
});

0 comments on commit 94eabff

Please sign in to comment.