diff --git a/packages/backend/src/graphql/queries/get-app-auth-clients.ee.js b/packages/backend/src/graphql/queries/get-app-auth-clients.ee.js
deleted file mode 100644
index 544aaa7e..00000000
--- a/packages/backend/src/graphql/queries/get-app-auth-clients.ee.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import AppConfig from '../../models/app-config.js';
-
-const getAppAuthClients = async (_parent, params, context) => {
- let canSeeAllClients = false;
- try {
- context.currentUser.can('read', 'App');
-
- canSeeAllClients = true;
- } catch {
- // void
- }
-
- const appConfig = await AppConfig.query()
- .findOne({
- key: params.appKey,
- })
- .throwIfNotFound();
-
- const appAuthClients = appConfig
- .$relatedQuery('appAuthClients')
- .where({ active: params.active })
- .skipUndefined();
-
- if (!canSeeAllClients) {
- appAuthClients.where({
- active: true,
- });
- }
-
- return await appAuthClients;
-};
-
-export default getAppAuthClients;
diff --git a/packages/backend/src/graphql/query-resolvers.js b/packages/backend/src/graphql/query-resolvers.js
index d7941d9c..4325c99c 100644
--- a/packages/backend/src/graphql/query-resolvers.js
+++ b/packages/backend/src/graphql/query-resolvers.js
@@ -1,6 +1,5 @@
import getApp from './queries/get-app.js';
import getAppAuthClient from './queries/get-app-auth-client.ee.js';
-import getAppAuthClients from './queries/get-app-auth-clients.ee.js';
import getBillingAndUsage from './queries/get-billing-and-usage.ee.js';
import getConnectedApps from './queries/get-connected-apps.js';
import getDynamicData from './queries/get-dynamic-data.js';
@@ -11,7 +10,6 @@ import testConnection from './queries/test-connection.js';
const queryResolvers = {
getApp,
getAppAuthClient,
- getAppAuthClients,
getBillingAndUsage,
getConnectedApps,
getDynamicData,
diff --git a/packages/backend/src/graphql/schema.graphql b/packages/backend/src/graphql/schema.graphql
index 356df968..cde88920 100644
--- a/packages/backend/src/graphql/schema.graphql
+++ b/packages/backend/src/graphql/schema.graphql
@@ -1,7 +1,6 @@
type Query {
getApp(key: String!): App
getAppAuthClient(id: String!): AppAuthClient
- getAppAuthClients(appKey: String!, active: Boolean): [AppAuthClient]
getConnectedApps(name: String): [App]
testConnection(id: String!): Connection
getFlow(id: String!): Flow
diff --git a/packages/web/src/components/AdminApplicationAuthClients/index.jsx b/packages/web/src/components/AdminApplicationAuthClients/index.jsx
index d9bc9135..114150f3 100644
--- a/packages/web/src/components/AdminApplicationAuthClients/index.jsx
+++ b/packages/web/src/components/AdminApplicationAuthClients/index.jsx
@@ -10,16 +10,18 @@ import Chip from '@mui/material/Chip';
import Button from '@mui/material/Button';
import * as URLS from 'config/urls';
import useFormatMessage from 'hooks/useFormatMessage';
-import useAppAuthClients from 'hooks/useAppAuthClients.ee';
+import useAdminAppAuthClients from 'hooks/useAdminAppAuthClients';
import NoResultFound from 'components/NoResultFound';
function AdminApplicationAuthClients(props) {
const { appKey } = props;
const formatMessage = useFormatMessage();
- const { appAuthClients, loading } = useAppAuthClients({ appKey });
- if (loading)
+ const { data: appAuthClients, isLoading } = useAdminAppAuthClients(appKey);
+
+ if (isLoading)
return ;
- if (!appAuthClients?.length) {
+
+ if (!appAuthClients?.data.length) {
return (
);
}
- const sortedAuthClients = appAuthClients.slice().sort((a, b) => {
+
+ const sortedAuthClients = appAuthClients.data.slice().sort((a, b) => {
if (a.id < b.id) {
return -1;
}
@@ -36,6 +39,7 @@ function AdminApplicationAuthClients(props) {
}
return 0;
});
+
return (
{sortedAuthClients.map((client) => (
diff --git a/packages/web/src/components/AppAuthClientsDialog/index.ee.jsx b/packages/web/src/components/AppAuthClientsDialog/index.ee.jsx
index e6258946..a9cce58d 100644
--- a/packages/web/src/components/AppAuthClientsDialog/index.ee.jsx
+++ b/packages/web/src/components/AppAuthClientsDialog/index.ee.jsx
@@ -6,29 +6,33 @@ import ListItem from '@mui/material/ListItem';
import ListItemButton from '@mui/material/ListItemButton';
import ListItemText from '@mui/material/ListItemText';
import * as React from 'react';
-import useAppAuthClients from 'hooks/useAppAuthClients.ee';
+import useAppAuthClients from 'hooks/useAppAuthClients';
import useFormatMessage from 'hooks/useFormatMessage';
function AppAuthClientsDialog(props) {
const { appKey, onClientClick, onClose } = props;
- const { appAuthClients } = useAppAuthClients({ appKey, active: true });
+ const { data: appAuthClients } = useAppAuthClients(appKey);
+
const formatMessage = useFormatMessage();
+
React.useEffect(
function autoAuthenticateSingleClient() {
- if (appAuthClients?.length === 1) {
- onClientClick(appAuthClients[0].id);
+ if (appAuthClients?.data.length === 1) {
+ onClientClick(appAuthClients.data[0].id);
}
},
- [appAuthClients],
+ [appAuthClients?.data],
);
- if (!appAuthClients?.length || appAuthClients?.length === 1)
+
+ if (!appAuthClients?.data.length || appAuthClients?.data.length === 1)
return ;
+
return (