Skip to content

Commit

Permalink
Removed unnecessary fields
Browse files Browse the repository at this point in the history
  • Loading branch information
git-init-priyanshu committed Mar 16, 2024
1 parent 0991f5c commit 0d13479
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 30 deletions.
5 changes: 0 additions & 5 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,9 @@ input CommentInput {

type Community {
_id: ID!
createdAt: DateTime
description: String!
logoUrl: String
name: String!
socialMediaUrls: SocialMediaUrls
timeout: Int
updatedAt: DateTime
websiteLink: String
}

Expand Down Expand Up @@ -1531,7 +1527,6 @@ input UpdateAgendaSectionInput {
}

input UpdateCommunityInput {
description: String!
logo: String!
name: String!
socialMediaUrls: SocialMediaUrlsInput!
Expand Down
6 changes: 0 additions & 6 deletions src/models/Community.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export interface InterfaceCommunity {
_id: Types.ObjectId;
name: string;
logoUrl: string;
description: string;
websiteLink: string;
socialMediaUrls: {
facebook: string;
Expand All @@ -25,7 +24,6 @@ export interface InterfaceCommunity {
/**
* This describes the schema for a `Community` that corresponds to `InterfaceCommunity` document.
* @param logoUrl - Community logo URL.
* @param description - Community description.
* @param socialMediaUrls - Social media URLs.
* @param facebook - Facebook URL.
* @param instagram - Instagram URL
Expand All @@ -47,10 +45,6 @@ const communitySchema = new Schema({
logoUrl: {
type: String,
},
description: {
type: String,
required: true,
},
websiteLink: {
type: String,
},
Expand Down
1 change: 0 additions & 1 deletion src/resolvers/Mutation/updateCommunity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const updateCommunity: MutationResolvers["updateCommunity"] = async (

await Community.create({
name: args.data.name,
description: args.data.description,
websiteLink: args.data.websiteLink,
logoUrl: args.data.logo,
socialMediaUrls: {
Expand Down
1 change: 0 additions & 1 deletion src/typeDefs/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ export const inputs = gql`
}
input UpdateCommunityInput {
description: String!
name: String!
socialMediaUrls: SocialMediaUrlsInput!
websiteLink: String!
Expand Down
4 changes: 0 additions & 4 deletions src/typeDefs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,8 @@ export const types = gql`
_id: ID!
name: String!
logoUrl: String
description: String!
websiteLink: String
socialMediaUrls: SocialMediaUrls
timeout: Int
createdAt: DateTime
updatedAt: DateTime
}
type UserFamily {
Expand Down
9 changes: 0 additions & 9 deletions src/types/generatedGraphQLTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,9 @@ export type CommentInput = {
export type Community = {
__typename?: 'Community';
_id: Scalars['ID']['output'];
createdAt?: Maybe<Scalars['DateTime']['output']>;
description: Scalars['String']['output'];
logoUrl?: Maybe<Scalars['String']['output']>;
name: Scalars['String']['output'];
socialMediaUrls?: Maybe<SocialMediaUrls>;
timeout?: Maybe<Scalars['Int']['output']>;
updatedAt?: Maybe<Scalars['DateTime']['output']>;
websiteLink?: Maybe<Scalars['String']['output']>;
};

Expand Down Expand Up @@ -2522,7 +2518,6 @@ export type UpdateAgendaSectionInput = {
};

export type UpdateCommunityInput = {
description: Scalars['String']['input'];
logo: Scalars['String']['input'];
name: Scalars['String']['input'];
socialMediaUrls: SocialMediaUrlsInput;
Expand Down Expand Up @@ -3473,13 +3468,9 @@ export type CommentResolvers<ContextType = any, ParentType extends ResolversPare

export type CommunityResolvers<ContextType = any, ParentType extends ResolversParentTypes['Community'] = ResolversParentTypes['Community']> = {
_id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
createdAt?: Resolver<Maybe<ResolversTypes['DateTime']>, ParentType, ContextType>;
description?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
logoUrl?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
name?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
socialMediaUrls?: Resolver<Maybe<ResolversTypes['SocialMediaUrls']>, ParentType, ContextType>;
timeout?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;
updatedAt?: Resolver<Maybe<ResolversTypes['DateTime']>, ParentType, ContextType>;
websiteLink?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};
Expand Down
6 changes: 2 additions & 4 deletions tests/resolvers/Mutation/updateCommunity.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ let testUser2: TestUserType;

const args: MutationUpdateCommunityArgs = {
data: {
description: "Test Descriptionj",
logo: "image.png",
name: "testName",
socialMediaUrls: {
Expand Down Expand Up @@ -100,9 +99,9 @@ describe("resolvers -> Mutation -> updateCommunity", () => {
"../../../src/resolvers/Mutation/updateCommunity"
);
await updateCommunityResolver?.({}, args, context);
} catch (error: any) {
} catch (error: unknown) {
expect(spy).toHaveBeenCalledWith(USER_NOT_AUTHORIZED_SUPERADMIN.MESSAGE);
expect(error.message).toEqual(
expect((error as Error).message).toEqual(
`Translated ${USER_NOT_AUTHORIZED_SUPERADMIN.MESSAGE}`,
);
}
Expand All @@ -111,7 +110,6 @@ describe("resolvers -> Mutation -> updateCommunity", () => {
it(`throws field cannot be empty error if websiteName, websiteLink or logo in passed empty`, async () => {
const args: MutationUpdateCommunityArgs = {
data: {
description: "",
logo: "",
name: "",
socialMediaUrls: {
Expand Down

0 comments on commit 0d13479

Please sign in to comment.