Skip to content

Commit

Permalink
defaultTopics
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronshiel committed Jan 26, 2024
1 parent 52fa95c commit da89927
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions node/src/gql/mutation/me/subject-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface CategoryUpdateInput {
id: string;
name: string;
description: string;
defaultTopic: string;
defaultTopics: string[];
}

export const CategoryInputType = new GraphQLInputObjectType({
Expand All @@ -42,7 +42,7 @@ export const CategoryInputType = new GraphQLInputObjectType({
id: { type: GraphQLID },
name: { type: GraphQLString },
description: { type: GraphQLString },
defaultTopic: { type: GraphQLString },
defaultTopics: { type: GraphQLList(GraphQLString) },
}),
});

Expand Down
2 changes: 1 addition & 1 deletion node/src/gql/types/subject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const CategoryType = new GraphQLObjectType({
id: { type: GraphQLID },
name: { type: GraphQLString },
description: { type: GraphQLString },
defaultTopic: { type: GraphQLString },
defaultTopics: { type: GraphQLList(GraphQLString) },
},
});

Expand Down
4 changes: 2 additions & 2 deletions node/src/models/Subject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface CategoryProps {
id: string;
name: string;
description: string;
defaultTopic: string;
defaultTopics: string[];
}

export interface Category extends CategoryProps, Document {
Expand All @@ -35,7 +35,7 @@ const CategorySchema = new Schema({
id: { type: String },
name: { type: String },
description: { type: String },
defaultTopic: { type: String, default: '' },
defaultTopics: [{ type: String, default: '' }],
});

export interface TopicProps {
Expand Down
2 changes: 1 addition & 1 deletion node/test/fixtures/mongodb/data-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ module.exports = {
id: 'category',
name: 'Category',
description: 'A test category',
defaultTopic: '5ffdf41a1ee2c62320b49ec2',
defaultTopics: ['5ffdf41a1ee2c62320b49ec2'],
},
],
topics: [
Expand Down
6 changes: 3 additions & 3 deletions node/test/graphql/mutation/me/subject-update.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('updateSubject', () => {
{
id: 'newcategory',
name: 'New category',
defaultTopic: '5ffdf41a1ee2c62320b49ec3',
defaultTopics: ['5ffdf41a1ee2c62320b49ec3'],
},
],
topics: [
Expand Down Expand Up @@ -160,7 +160,7 @@ describe('updateSubject', () => {
categories {
id
name
defaultTopic
defaultTopics
}
topics {
id
Expand Down Expand Up @@ -197,7 +197,7 @@ describe('updateSubject', () => {
{
id: 'newcategory',
name: 'New category',
defaultTopic: '5ffdf41a1ee2c62320b49ec3',
defaultTopics: ['5ffdf41a1ee2c62320b49ec3'],
},
],
topics: [
Expand Down
4 changes: 2 additions & 2 deletions node/test/graphql/query/subjects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('subjects', () => {
name
isRequired
categories{
defaultTopic
defaultTopics
}
}
}
Expand Down Expand Up @@ -65,7 +65,7 @@ describe('subjects', () => {
isRequired: true,
categories: [
{
defaultTopic: '5ffdf41a1ee2c62320b49ec2',
defaultTopics: ['5ffdf41a1ee2c62320b49ec2'],
},
],
},
Expand Down

0 comments on commit da89927

Please sign in to comment.