Merge pull request #1713 from automatisch/fix-auth-client-auth-fields
fix: use useAppAuth for getting auth fields
This commit is contained in:
@@ -8,23 +8,25 @@ import { UPDATE_APP_AUTH_CLIENT } from 'graphql/mutations/update-app-auth-client
|
||||
import useFormatMessage from 'hooks/useFormatMessage';
|
||||
import AdminApplicationAuthClientDialog from 'components/AdminApplicationAuthClientDialog';
|
||||
import useAdminAppAuthClient from 'hooks/useAdminAppAuthClient.ee';
|
||||
import useAppAuth from 'hooks/useAppAuth';
|
||||
|
||||
function AdminApplicationUpdateAuthClient(props) {
|
||||
const { application, onClose } = props;
|
||||
const { auth } = application;
|
||||
const formatMessage = useFormatMessage();
|
||||
const { clientId } = useParams();
|
||||
|
||||
const { data: adminAppAuthClient, isLoading: isAdminAuthClientLoading } =
|
||||
useAdminAppAuthClient(clientId);
|
||||
|
||||
const { data: auth } = useAppAuth(application.key);
|
||||
|
||||
const [updateAppAuthClient, { loading: loadingUpdateAppAuthClient, error }] =
|
||||
useMutation(UPDATE_APP_AUTH_CLIENT, {
|
||||
refetchQueries: ['GetAppAuthClients'],
|
||||
context: { autoSnackbar: false },
|
||||
});
|
||||
|
||||
const authFields = auth?.fields?.map((field) => ({
|
||||
const authFields = auth?.data?.fields?.map((field) => ({
|
||||
...field,
|
||||
required: false,
|
||||
}));
|
||||
|
Reference in New Issue
Block a user