Skip to content

Commit

Permalink
chore!: removed reportMessage method (#32633)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavkrin authored and ggazzo committed Sep 13, 2024
1 parent 0c94f3d commit 33d23f3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 101 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IMessage } from '@rocket.chat/core-typings';
import { css } from '@rocket.chat/css-in-js';
import { TextAreaInput, FieldGroup, Field, FieldRow, FieldError, Box } from '@rocket.chat/fuselage';
import { useToastMessageDispatch, useTranslation, useMethod } from '@rocket.chat/ui-contexts';
import { useToastMessageDispatch, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import React from 'react';
import { useForm } from 'react-hook-form';
Expand Down Expand Up @@ -31,13 +31,13 @@ const ReportMessageModal = ({ message, onClose }: ReportMessageModalProps): Reac
handleSubmit,
} = useForm<ReportMessageModalsFields>();
const dispatchToastMessage = useToastMessageDispatch();
const reportMessage = useMethod('reportMessage');
const reportMessage = useEndpoint('POST', '/v1/chat.reportMessage');

const { _id } = message;

const handleReportMessage = async ({ description }: ReportMessageModalsFields): Promise<void> => {
try {
await reportMessage(_id, description);
await reportMessage({ messageId: _id, description });
dispatchToastMessage({ type: 'success', message: t('Report_has_been_sent') });
} catch (error) {
dispatchToastMessage({ type: 'error', message: error });
Expand Down
1 change: 0 additions & 1 deletion apps/meteor/server/methods/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import './removeRoomLeader';
import './removeRoomModerator';
import './removeRoomOwner';
import './removeUserFromRoom';
import './reportMessage';
import './requestDataDownload';
import './resetAvatar';
import './saveUserPreferences';
Expand Down
97 changes: 0 additions & 97 deletions apps/meteor/server/methods/reportMessage.ts

This file was deleted.

0 comments on commit 33d23f3

Please sign in to comment.