Skip to content

Commit

Permalink
chore: Deprecate un-used meteor method for omnichannel analytics (#30421
Browse files Browse the repository at this point in the history
)
  • Loading branch information
murtaza98 authored Sep 29, 2023
1 parent 59f581d commit 7493442
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/thirty-jokes-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

chore: Deprecate un-used meteor method for omnichannel analytics
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ declare module '@rocket.chat/ui-contexts' {

Meteor.methods<ServerMethods>({
async 'livechat:getAgentOverviewData'(options) {
methodDeprecationLogger.warn(
'The method "livechat:getAgentOverviewData" is deprecated and will be removed after version v7.0.0. Use "livechat/analytics/agent-overview" instead.',
);
methodDeprecationLogger.method('livechat:getAgentOverviewData', '7.0.0', ' Use "livechat/analytics/agent-overview" instead.');

const uid = Meteor.userId();
if (!uid || !(await hasPermissionAsync(uid, 'view-livechat-manager'))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { ServerMethods, TranslationKey } from '@rocket.chat/ui-contexts';
import { Meteor } from 'meteor/meteor';

import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission';
import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
import { settings } from '../../../settings/server';
import { Livechat } from '../lib/Livechat';

Expand All @@ -18,6 +19,7 @@ declare module '@rocket.chat/ui-contexts' {

Meteor.methods<ServerMethods>({
async 'livechat:getAnalyticsOverviewData'(options) {
methodDeprecationLogger.method('livechat:getAnalyticsOverviewData', '7.0.0', ' Use "livechat/analytics/overview" instead.');
const uid = Meteor.userId();
if (!uid || !(await hasPermissionAsync(uid, 'view-livechat-manager'))) {
throw new Meteor.Error('error-not-allowed', 'Not allowed', {
Expand Down

0 comments on commit 7493442

Please sign in to comment.