Skip to content

Commit

Permalink
fix typos in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
meetulr committed Jan 7, 2024
1 parent 991ea31 commit 7aa48a4
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/models/Organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface InterfaceOrganization {
* @param status - Status.
* @param members - Collection of members, each object refer to `User` model.
* @param admins - Collection of organization admins, each object refer to `User` model.
* @param actionCategories - COllection of categories belonging to an organization, refer to `Category` model.
* @param actionCategories - Collection of categories belonging to an organization, refer to `Category` model.
* @param groupChats - Collection of group chats, each object refer to `Message` model.
* @param posts - Collection of Posts in the Organization, each object refer to `Post` model.
* @param membershipRequests - Collection of membership requests in the Organization, each object refer to `MembershipRequest` model.
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/Mutation/createCategory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { findOrganizationsInCache } from "../../services/OrganizationCache/findO
import { cacheOrganizations } from "../../services/OrganizationCache/cacheOrganizations";

/**
* This function enables to create a task.
* This function enables to create a Category.
* @param _parent - parent of current request
* @param args - payload provided with the request
* @param context - context of entire application
Expand Down
4 changes: 2 additions & 2 deletions src/resolvers/Mutation/removeActionItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import { Types } from "mongoose";
import { findEventsInCache } from "../../services/EventCache/findEventInCache";
import { cacheEvents } from "../../services/EventCache/cacheEvents";
/**
* This function enables to update a task.
* This function enables to remove an action item.
* @param _parent - parent of current request
* @param args - payload provided with the request
* @param context - context of entire application
* @remarks The following checks are done:
* 1. If the user exists.
* 2. If the action item exists.
* 3. If the user is authorized.
* @returns Updated action item.
* @returns deleted action item.
*/

export const removeActionItem: MutationResolvers["removeActionItem"] = async (
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/Mutation/updateActionItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Types } from "mongoose";
import { findEventsInCache } from "../../services/EventCache/findEventInCache";
import { cacheEvents } from "../../services/EventCache/cacheEvents";
/**
* This function enables to update a task.
* This function enables to update an action item.
* @param _parent - parent of current request
* @param args - payload provided with the request
* @param context - context of entire application
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/Mutation/updateCategory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { errors, requestContext } from "../../libraries";
import { User, Category } from "../../models";
import { adminCheck } from "../../utilities";
/**
* This function enables to update a task.
* This function enables to update a category.
* @param _parent - parent of current request
* @param args - payload provided with the request
* @param context - context of entire application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import { ActionItem } from "../../models";
* @param args - An object that contains `eventId` which is the _id of the Event.
* @returns An `actionItems` object that holds all action items for the Event.
*/
export const actionItemsByEvents: QueryResolvers["actionItemsByEvents"] =
async (_parent, args) => {
const actionItems = await ActionItem.find({
event: args.eventId,
}).lean();
export const actionItemsByEvent: QueryResolvers["actionItemsByEvent"] = async (
_parent,
args
) => {
const actionItems = await ActionItem.find({
event: args.eventId,
}).lean();

return actionItems;
};
return actionItems;
};
4 changes: 2 additions & 2 deletions src/resolvers/Query/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { QueryResolvers } from "../../types/generatedGraphQLTypes";
import { actionItem } from "./actionItem";
import { actionItemsByEvents } from "./actionItemsByEvents";
import { actionItemsByEvent } from "./actionItemsByEvent";
import { category } from "./category";
import { categoriesByOrganization } from "./categoriesByOrganization";
import { checkAuth } from "./checkAuth";
Expand Down Expand Up @@ -34,7 +34,7 @@ import { usersConnection } from "./usersConnection";

export const Query: QueryResolvers = {
actionItem,
actionItemsByEvents,
actionItemsByEvent,
category,
categoriesByOrganization,
checkAuth,
Expand Down
2 changes: 1 addition & 1 deletion src/typeDefs/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const queries = gql`
actionItem(id: ID!): ActionItem
actionItemsByEvents(eventId: ID!): [ActionItem]
actionItemsByEvent(eventId: ID!): [ActionItem]
category(id: ID!): Category
Expand Down
6 changes: 3 additions & 3 deletions src/types/generatedGraphQLTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ export type PostWhereInput = {
export type Query = {
__typename?: 'Query';
actionItem?: Maybe<ActionItem>;
actionItemsByEvents?: Maybe<Array<Maybe<ActionItem>>>;
actionItemsByEvent?: Maybe<Array<Maybe<ActionItem>>>;
adminPlugin?: Maybe<Array<Maybe<Plugin>>>;
categoriesByOrganization?: Maybe<Array<Maybe<Category>>>;
category?: Maybe<Category>;
Expand Down Expand Up @@ -1472,7 +1472,7 @@ export type QueryActionItemArgs = {
};


export type QueryActionItemsByEventsArgs = {
export type QueryActionItemsByEventArgs = {
eventId: Scalars['ID'];
};

Expand Down Expand Up @@ -2931,7 +2931,7 @@ export type PostConnectionResolvers<ContextType = any, ParentType extends Resolv

export type QueryResolvers<ContextType = any, ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']> = {
actionItem?: Resolver<Maybe<ResolversTypes['ActionItem']>, ParentType, ContextType, RequireFields<QueryActionItemArgs, 'id'>>;
actionItemsByEvents?: Resolver<Maybe<Array<Maybe<ResolversTypes['ActionItem']>>>, ParentType, ContextType, RequireFields<QueryActionItemsByEventsArgs, 'eventId'>>;
actionItemsByEvent?: Resolver<Maybe<Array<Maybe<ResolversTypes['ActionItem']>>>, ParentType, ContextType, RequireFields<QueryActionItemsByEventArgs, 'eventId'>>;
adminPlugin?: Resolver<Maybe<Array<Maybe<ResolversTypes['Plugin']>>>, ParentType, ContextType, RequireFields<QueryAdminPluginArgs, 'orgId'>>;
categoriesByOrganization?: Resolver<Maybe<Array<Maybe<ResolversTypes['Category']>>>, ParentType, ContextType, RequireFields<QueryCategoriesByOrganizationArgs, 'orgId'>>;
category?: Resolver<Maybe<ResolversTypes['Category']>, ParentType, ContextType, RequireFields<QueryCategoryArgs, 'id'>>;
Expand Down
2 changes: 1 addition & 1 deletion tests/resolvers/ActionItem/assignedTo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ afterAll(async () => {
await disconnect(MONGOOSE_INSTANCE);
});

describe("resolvers -> ActionItem -> assignedBy", () => {
describe("resolvers -> ActionItem -> assignedTo", () => {
it(`returns the assignee for parent action item`, async () => {
const parent = testActionItem?.toObject();

Expand Down
2 changes: 1 addition & 1 deletion tests/resolvers/Category/updatedBy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ afterAll(async () => {
await disconnect(MONGOOSE_INSTANCE);
});

describe("resolvers -> Category -> updated", () => {
describe("resolvers -> Category -> updatedBy", () => {
it(`returns the user that last updated the parent category`, async () => {
const parent = testCategory?.toObject();

Expand Down
4 changes: 2 additions & 2 deletions tests/resolvers/Mutation/updateCategory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe("resolvers -> Mutation -> updateCategoryResolver", () => {
}
});

it(`updated the category and returns it as an admin`, async () => {
it(`updates the category and returns it as an admin`, async () => {
const args: MutationUpdateCategoryArgs = {
id: testCategory?._id,
data: {
Expand All @@ -127,7 +127,7 @@ describe("resolvers -> Mutation -> updateCategoryResolver", () => {
);
});

it(`updated the category and returns it as superadmin`, async () => {
it(`updates the category and returns it as superadmin`, async () => {
const superAdminTestUser = await User.findOneAndUpdate(
{
_id: randomUser?._id,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import "dotenv/config";
import { ActionItem } from "../../../src/models";
import { connect, disconnect } from "../../helpers/db";
import type { QueryActionItemsByEventsArgs } from "../../../src/types/generatedGraphQLTypes";
import { actionItemsByEvents as actionItemsByEventsResolver } from "../../../src/resolvers/Query/actionItemsByEvents";
import type { QueryActionItemsByEventArgs } from "../../../src/types/generatedGraphQLTypes";
import { actionItemsByEvent as actionItemsByEventsResolver } from "../../../src/resolvers/Query/actionItemsByEvent";
import { beforeAll, afterAll, describe, it, expect } from "vitest";
import type mongoose from "mongoose";
import { createTestActionItems } from "../../helpers/actionItem";
Expand All @@ -22,7 +22,7 @@ afterAll(async () => {

describe("resolvers -> Query -> actionItemsByEvent", () => {
it(`returns list of all action items associated with an event`, async () => {
const args: QueryActionItemsByEventsArgs = {
const args: QueryActionItemsByEventArgs = {
eventId: testEvent?._id,
};

Expand Down

0 comments on commit 7aa48a4

Please sign in to comment.