Skip to content

Commit

Permalink
fix: removed permission check from useLicense
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandernsilva committed Oct 18, 2023
1 parent be524f9 commit cd58aec
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions apps/meteor/client/hooks/useLicense.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import { useEndpoint, usePermission } from '@rocket.chat/ui-contexts';
import { useEndpoint } from '@rocket.chat/ui-contexts';
import { useQuery } from '@tanstack/react-query';

export const useLicense = () => {
const getLicenses = useEndpoint('GET', '/v1/licenses.info');
const canViewLicense = usePermission('view-privileged-setting');

return useQuery(
['licenses', 'getLicenses'],
async () => {
if (!canViewLicense) {
throw new Error('unauthorized api call');
}

const { data } = await getLicenses({ loadValues: true });

return data;
Expand Down

0 comments on commit cd58aec

Please sign in to comment.