diff --git a/schema.graphql b/schema.graphql index 9bfd49671c..80ca281f73 100644 --- a/schema.graphql +++ b/schema.graphql @@ -214,25 +214,6 @@ type DeletePayload { success: Boolean! } -type DirectChat { - _id: ID! - createdAt: DateTime! - creator: User - messages: [DirectChatMessage] - updatedAt: DateTime! - users: [User!]! -} - -type DirectChatMessage { - _id: ID! - createdAt: DateTime! - directChatMessageBelongsTo: DirectChat! - messageContent: String! - receiver: User! - sender: User! - updatedAt: DateTime! -} - type Donation { _id: ID! amount: Float! @@ -470,26 +451,6 @@ type Group { updatedAt: DateTime! } -type GroupChat { - _id: ID! - title: String! - createdAt: DateTime! - creator: User - messages: [GroupChatMessage] - organization: Organization! - updatedAt: DateTime! - users: [User!]! -} - -type GroupChatMessage { - _id: ID! - createdAt: DateTime! - groupChatMessageBelongsTo: GroupChat! - messageContent: String! - sender: User! - updatedAt: DateTime! -} - type InvalidCursor implements FieldError { message: String! path: [String!]! @@ -579,31 +540,6 @@ type MembershipRequest { user: User! } -type Message { - _id: ID! - createdAt: DateTime! - creator: User - imageUrl: URL - text: String! - updatedAt: DateTime! - videoUrl: URL -} - -type MessageChat { - _id: ID! - createdAt: DateTime! - languageBarrier: Boolean - message: String! - receiver: User! - sender: User! - updatedAt: DateTime! -} - -input MessageChatInput { - message: String! - receiver: ID! -} - type MinimumLengthError implements FieldError { limit: Int! message: String! @@ -659,10 +595,8 @@ type Mutation { organizationId: ID! ): UserCustomData! addUserImage(file: String!): User! - addUserToGroupChat(chatId: ID!, userId: ID!): GroupChat! addUserToUserFamily(familyId: ID!, userId: ID!): UserFamily! adminRemoveEvent(eventId: ID!): Event! - adminRemoveGroup(groupId: ID!): GroupChat! assignUserTag(input: ToggleUserTagAssignInput!): User blockPluginCreationBySuperadmin( blockUser: Boolean! @@ -692,7 +626,6 @@ type Mutation { createAgendaCategory(input: CreateAgendaCategoryInput!): AgendaCategory! createComment(data: CommentInput!, postId: ID!): Comment createChat(data: chatInput!): Chat! - createDirectChat(data: createChatInput!): DirectChat! createDonation( amount: Float! nameOfOrg: String! @@ -706,9 +639,7 @@ type Mutation { recurrenceRuleData: RecurrenceRuleInput ): Event! createEventVolunteer(data: EventVolunteerInput!): EventVolunteer! - createGroupChat(data: createGroupChatInput!): GroupChat! createMember(input: UserAndOrganizationInput!): Organization! - createMessageChat(data: MessageChatInput!): MessageChat! createOrganization(data: OrganizationInput, file: String): Organization! createPlugin( pluginCreatedBy: String! @@ -743,11 +674,9 @@ type Mutation { removeAdmin(data: UserAndOrganizationInput!): AppUserProfile! removeAdvertisement(id: ID!): Advertisement removeComment(id: ID!): Comment - removeDirectChat(chatId: ID!, organizationId: ID!): DirectChat! removeEvent(id: ID!): Event! removeEventAttendee(data: EventAttendeeInput!): User! removeEventVolunteer(id: ID!): EventVolunteer! - removeGroupChat(chatId: ID!): GroupChat! removeMember(data: UserAndOrganizationInput!): Organization! removeOrganization(id: ID!): UserData! removeOrganizationCustomField( @@ -759,7 +688,6 @@ type Mutation { removeSampleOrganization: Boolean! removeUserCustomData(organizationId: ID!): UserCustomData! removeUserFamily(familyId: ID!): UserFamily! - removeUserFromGroupChat(chatId: ID!, userId: ID!): GroupChat! removeUserFromUserFamily(familyId: ID!, userId: ID!): UserFamily! removeUserImage: User! removeUserTag(id: ID!): UserTag @@ -767,14 +695,6 @@ type Mutation { saveFcmToken(token: String): Boolean! sendMembershipRequest(organizationId: ID!): MembershipRequest! sendMessageToChat(chatId: ID!, messageContent: String!, type: String!, replyTo: ID): ChatMessage! - sendMessageToDirectChat( - chatId: ID! - messageContent: String! - ): DirectChatMessage! - sendMessageToGroupChat( - chatId: ID! - messageContent: String! - ): GroupChatMessage! signUp(data: UserInput!, file: String): AuthData! togglePostPin(id: ID!, title: String): Post! unassignUserTag(input: ToggleUserTagAssignInput!): User @@ -1096,11 +1016,6 @@ type Query { customFieldsByOrganization(id: ID!): [OrganizationCustomField] chatById(id: ID!): Chat! chatsByUserId(id: ID!): [Chat] - directChatsByUserID(id: ID!): [DirectChat] - directChatsMessagesByChatID(id: ID!): [DirectChatMessage] - directChatById(id: ID!): DirectChat - groupChatById(id: ID!): DirectChat - groupChatsByUserId(id: ID!): [GroupChat] event(id: ID!): Event eventVolunteersByEvent(id: ID!): [EventVolunteer] eventsByOrganization(id: ID, orderBy: EventOrderByInput): [Event] @@ -1195,10 +1110,7 @@ enum Status { } type Subscription { - directMessageChat: MessageChat messageSentToChat(userId: ID!): ChatMessage - messageSentToDirectChat(userId: ID!): DirectChatMessage - messageSentToGroupChat(userId: ID!): GroupChatMessage onPluginUpdate: Plugin } @@ -1592,17 +1504,6 @@ enum WeekDays { WE } -input createChatInput { - organizationId: ID - userIds: [ID!]! -} - -input createGroupChatInput { - organizationId: ID! - title: String! - userIds: [ID!]! -} - type Venue { _id: ID! capacity: Int! diff --git a/src/GraphQl/Mutations/OrganizationMutations.ts b/src/GraphQl/Mutations/OrganizationMutations.ts index a939585aaf..68a0c9026c 100644 --- a/src/GraphQl/Mutations/OrganizationMutations.ts +++ b/src/GraphQl/Mutations/OrganizationMutations.ts @@ -50,7 +50,7 @@ export const REMOVE_SAMPLE_ORGANIZATION_MUTATION = gql` `; /** - * GraphQL mutation to create a direct chat between users in an organization. + * GraphQL mutation to create a chat between users in an organization. * * @param userIds - An array of user IDs participating in the direct chat. * @param organizationId - The ID of the organization where the direct chat is created. diff --git a/src/GraphQl/Queries/PlugInQueries.ts b/src/GraphQl/Queries/PlugInQueries.ts index 91e7a29d07..36a132a09c 100644 --- a/src/GraphQl/Queries/PlugInQueries.ts +++ b/src/GraphQl/Queries/PlugInQueries.ts @@ -100,14 +100,12 @@ export const ORGANIZATION_EVENTS_CONNECTION = gql` `; /** - * GraphQL query to retrieve a list of direct chats based on user ID. + * GraphQL query to retrieve a list of chats based on user ID. * - * @param id - The ID of the user for which direct chats are being retrieved. - * @returns The list of direct chats associated with the user, including details such as ID, creator, messages, organization, and participating users. + * @param id - The ID of the user for which chats are being retrieved. + * @returns The list of chats associated with the user, including details such as ID, creator, messages, organization, and participating users. */ -// directChatsMessagesByChatID(id: ID!): [DirectChatMessage] - export const CHAT_BY_ID = gql` query chatById($id: ID!) { chatById(id: $id) { diff --git a/src/components/UserPortal/CreateDirectChat/CreateDirectChat.test.tsx b/src/components/UserPortal/CreateDirectChat/CreateDirectChat.test.tsx index e3e2eae75c..645b663579 100644 --- a/src/components/UserPortal/CreateDirectChat/CreateDirectChat.test.tsx +++ b/src/components/UserPortal/CreateDirectChat/CreateDirectChat.test.tsx @@ -356,7 +356,7 @@ const MESSAGE_SENT_TO_CHAT_MOCK = [ }, result: { data: { - messageSentToGroupChat: { + messageSentToChat: { _id: '668ec1f1df364e03ac47a151', createdAt: '2024-07-10T17:16:33.248Z', messageContent: 'Test ', @@ -382,7 +382,7 @@ const MESSAGE_SENT_TO_CHAT_MOCK = [ }, result: { data: { - messageSentToGroupChat: { + messageSentToChat: { _id: '668ec1f13603ac4697a151', createdAt: '2024-07-10T17:16:33.248Z', messageContent: 'Test ', diff --git a/src/components/UserPortal/CreateGroupChat/CreateGroupChat.test.tsx b/src/components/UserPortal/CreateGroupChat/CreateGroupChat.test.tsx index 7eeaeacac1..055985d5fb 100644 --- a/src/components/UserPortal/CreateGroupChat/CreateGroupChat.test.tsx +++ b/src/components/UserPortal/CreateGroupChat/CreateGroupChat.test.tsx @@ -1234,7 +1234,7 @@ const MESSAGE_SENT_TO_CHAT_MOCK = [ }, result: { data: { - messageSentToGroupChat: { + messageSentToChat: { _id: '668ec1f1df364e03ac47a151', createdAt: '2024-07-10T17:16:33.248Z', messageContent: 'Test ', @@ -1260,7 +1260,7 @@ const MESSAGE_SENT_TO_CHAT_MOCK = [ }, result: { data: { - messageSentToGroupChat: { + messageSentToChat: { _id: '668ec1f13603ac4697a151', createdAt: '2024-07-10T17:16:33.248Z', messageContent: 'Test ', diff --git a/src/components/UserPortal/CreateGroupChat/CreateGroupChat.tsx b/src/components/UserPortal/CreateGroupChat/CreateGroupChat.tsx index 099a42310a..ba9fca9fdb 100644 --- a/src/components/UserPortal/CreateGroupChat/CreateGroupChat.tsx +++ b/src/components/UserPortal/CreateGroupChat/CreateGroupChat.tsx @@ -201,28 +201,6 @@ export default function CreateGroupChat({
- {/* - Select Organization - - */} Select Organization