From 53be17a3c2b6057a838424182d929c7b7cb5f1ab Mon Sep 17 00:00:00 2001 From: Khaled FERJANI Date: Mon, 11 Mar 2024 11:47:05 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F=20chore:=20removed=20debu?= =?UTF-8?q?g=20helper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../channels/web/controllers/channel.ts | 53 ------------------- .../node/src/services/channels/web/routes.ts | 6 --- 2 files changed, 59 deletions(-) diff --git a/twake/backend/node/src/services/channels/web/controllers/channel.ts b/twake/backend/node/src/services/channels/web/controllers/channel.ts index f38e839404..43091f79e1 100644 --- a/twake/backend/node/src/services/channels/web/controllers/channel.ts +++ b/twake/backend/node/src/services/channels/web/controllers/channel.ts @@ -386,59 +386,6 @@ export class ChannelCrudController }; } - async listDebug( - request: FastifyRequest<{ - Querystring: ChannelListQueryParameters; - Params: BaseChannelsParameters; - }>, - ): Promise> { - const context = getExecutionContext(request); - // TODO: remove when debug is done. - context.user = { - server_request: true, - id: "12d4bb30-7274-11ea-a178-0242ac120004", - email: "kferjani@linagora.com", - identity_provider_id: "5ffd789d5010fa00196f360d", - }; - - const list = await gr.services.channels.channels.list( - new Pagination(request.query.page_token, request.query.limit), - { ...request.query }, - context, - ); - - let entities = []; - if (request.query.include_users) { - entities = []; - for (const e of list.getEntities()) { - entities.push( - await gr.services.channels.channels.includeUsersInDirectChannel(e, context.user.id), - ); - } - } else { - entities = list.getEntities(); - } - - const resources = entities.map(a => ChannelObject.mapTo(a)); - - await gr.services.channels.channels.completeWithStatistics(resources); - - return { - ...{ - resources: resources, - }, - ...(request.query.websockets && { - websockets: gr.platformServices.realtime.sign( - getWorkspaceRooms(request.params, request.currentUser), - request.currentUser.id, - ), - }), - ...(list.page_token && { - next_page_token: list.page_token, - }), - }; - } - async delete( request: FastifyRequest<{ Params: ChannelParameters }>, reply: FastifyReply, diff --git a/twake/backend/node/src/services/channels/web/routes.ts b/twake/backend/node/src/services/channels/web/routes.ts index 0c45972e6f..3e40beb75c 100644 --- a/twake/backend/node/src/services/channels/web/routes.ts +++ b/twake/backend/node/src/services/channels/web/routes.ts @@ -69,12 +69,6 @@ const routes: FastifyPluginCallback = (fastify: FastifyInstance, options, next) handler: channelsController.list.bind(channelsController), }); - fastify.route({ - method: "GET", - url: `${channelsUrl}debug`, - handler: channelsController.listDebug.bind(channelsController), - }); - fastify.route({ method: "GET", url: `${channelsUrl}/:id`,