From 8c7752a4104c9034ec93224be3e1c3ccd14e0633 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Fri, 16 Aug 2024 18:58:27 -0300 Subject: [PATCH] fix review --- apps/meteor/app/api/server/v1/channels.ts | 2 +- apps/meteor/app/api/server/v1/groups.ts | 2 +- apps/meteor/app/api/server/v1/im.ts | 2 +- apps/meteor/app/api/server/v1/rooms.ts | 2 +- apps/meteor/app/api/server/v1/teams.ts | 2 +- apps/meteor/server/{methods => lib}/eraseRoom.ts | 3 +-- apps/meteor/server/methods/index.ts | 1 - 7 files changed, 6 insertions(+), 8 deletions(-) rename apps/meteor/server/{methods => lib}/eraseRoom.ts (93%) diff --git a/apps/meteor/app/api/server/v1/channels.ts b/apps/meteor/app/api/server/v1/channels.ts index d6d168f4b64f9..5cd0ae5b41532 100644 --- a/apps/meteor/app/api/server/v1/channels.ts +++ b/apps/meteor/app/api/server/v1/channels.ts @@ -24,7 +24,7 @@ import { Meteor } from 'meteor/meteor'; import { isTruthy } from '../../../../lib/isTruthy'; import { findUsersOfRoom } from '../../../../server/lib/findUsersOfRoom'; -import { eraseRoom } from '../../../../server/methods/eraseRoom'; +import { eraseRoom } from '../../../../server/lib/eraseRoom'; import { hideRoomMethod } from '../../../../server/methods/hideRoom'; import { removeUserFromRoomMethod } from '../../../../server/methods/removeUserFromRoom'; import { canAccessRoomAsync } from '../../../authorization/server'; diff --git a/apps/meteor/app/api/server/v1/groups.ts b/apps/meteor/app/api/server/v1/groups.ts index 90f6ccbeed858..6e20290945f73 100644 --- a/apps/meteor/app/api/server/v1/groups.ts +++ b/apps/meteor/app/api/server/v1/groups.ts @@ -6,7 +6,7 @@ import { Meteor } from 'meteor/meteor'; import type { Filter } from 'mongodb'; import { findUsersOfRoom } from '../../../../server/lib/findUsersOfRoom'; -import { eraseRoom } from '../../../../server/methods/eraseRoom'; +import { eraseRoom } from '../../../../server/lib/eraseRoom'; import { hideRoomMethod } from '../../../../server/methods/hideRoom'; import { removeUserFromRoomMethod } from '../../../../server/methods/removeUserFromRoom'; import { canAccessRoomAsync, roomAccessAttributes } from '../../../authorization/server'; diff --git a/apps/meteor/app/api/server/v1/im.ts b/apps/meteor/app/api/server/v1/im.ts index 90d5ed6015f2a..cf55746e24e66 100644 --- a/apps/meteor/app/api/server/v1/im.ts +++ b/apps/meteor/app/api/server/v1/im.ts @@ -15,7 +15,7 @@ import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { createDirectMessage } from '../../../../server/methods/createDirectMessage'; -import { eraseRoom } from '../../../../server/methods/eraseRoom'; +import { eraseRoom } from '../../../../server/lib/eraseRoom'; import { hideRoomMethod } from '../../../../server/methods/hideRoom'; import { canAccessRoomIdAsync } from '../../../authorization/server/functions/canAccessRoom'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; diff --git a/apps/meteor/app/api/server/v1/rooms.ts b/apps/meteor/app/api/server/v1/rooms.ts index e3296b98ef178..d3ad2d68ea740 100644 --- a/apps/meteor/app/api/server/v1/rooms.ts +++ b/apps/meteor/app/api/server/v1/rooms.ts @@ -8,7 +8,7 @@ import { Meteor } from 'meteor/meteor'; import { isTruthy } from '../../../../lib/isTruthy'; import { omit } from '../../../../lib/utils/omit'; import * as dataExport from '../../../../server/lib/dataExport'; -import { eraseRoom } from '../../../../server/methods/eraseRoom'; +import { eraseRoom } from '../../../../server/lib/eraseRoom'; import { muteUserInRoom } from '../../../../server/methods/muteUserInRoom'; import { unmuteUserInRoom } from '../../../../server/methods/unmuteUserInRoom'; import { canAccessRoomAsync, canAccessRoomIdAsync } from '../../../authorization/server/functions/canAccessRoom'; diff --git a/apps/meteor/app/api/server/v1/teams.ts b/apps/meteor/app/api/server/v1/teams.ts index 71f1142219321..b92b84b479252 100644 --- a/apps/meteor/app/api/server/v1/teams.ts +++ b/apps/meteor/app/api/server/v1/teams.ts @@ -15,7 +15,7 @@ import { import { escapeRegExp } from '@rocket.chat/string-helpers'; import { Match, check } from 'meteor/check'; -import { eraseRoom } from '../../../../server/methods/eraseRoom'; +import { eraseRoom } from '../../../../server/lib/eraseRoom'; import { canAccessRoomAsync } from '../../../authorization/server'; import { hasPermissionAsync, hasAtLeastOnePermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { removeUserFromRoom } from '../../../lib/server/functions/removeUserFromRoom'; diff --git a/apps/meteor/server/methods/eraseRoom.ts b/apps/meteor/server/lib/eraseRoom.ts similarity index 93% rename from apps/meteor/server/methods/eraseRoom.ts rename to apps/meteor/server/lib/eraseRoom.ts index 4d288448ea557..d67de3325eea9 100644 --- a/apps/meteor/server/methods/eraseRoom.ts +++ b/apps/meteor/server/lib/eraseRoom.ts @@ -1,12 +1,11 @@ import { AppEvents, Apps } from '@rocket.chat/apps'; import { Message, Team } from '@rocket.chat/core-services'; -import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission'; import { deleteRoom } from '../../app/lib/server/functions/deleteRoom'; -import { roomCoordinator } from '../lib/rooms/roomCoordinator'; +import { roomCoordinator } from './rooms/roomCoordinator'; export async function eraseRoom(rid: string, uid: string): Promise { const room = await Rooms.findOneById(rid); diff --git a/apps/meteor/server/methods/index.ts b/apps/meteor/server/methods/index.ts index 27c3459646375..a3b4b747f7159 100644 --- a/apps/meteor/server/methods/index.ts +++ b/apps/meteor/server/methods/index.ts @@ -12,7 +12,6 @@ import './channelsList'; import './createDirectMessage'; import './deleteFileMessage'; import './deleteUser'; -import './eraseRoom'; import './getAvatarSuggestion'; import './getPasswordPolicy'; import './getRoomById';