feat: add useAppAuth with RQ

This commit is contained in:
Rıdvan Akca
2024-03-07 15:54:00 +03:00
parent a4c0edf493
commit 2ee5af8bfb
8 changed files with 68 additions and 53 deletions

View File

@@ -28,12 +28,12 @@ import AddAppConnection from 'components/AddAppConnection';
import AppIcon from 'components/AppIcon';
import Container from 'components/Container';
import PageTitle from 'components/PageTitle';
import api from 'helpers/api';
import { useQuery } from '@tanstack/react-query';
import useApp from 'hooks/useApp';
const ReconnectConnection = (props) => {
const { application, onClose } = props;
const { connectionId } = useParams();
return (
<AddAppConnection
onClose={onClose}
@@ -56,18 +56,7 @@ export default function Application() {
const { appKey } = useParams();
const navigate = useNavigate();
const { data, loading } = useQuery({
queryKey: ['app', appKey],
queryFn: async ({ payload, signal }) => {
const { data } = await api.get(`/v1/apps/${appKey}`, {
signal,
});
return data;
},
enabled: !!appKey,
});
const { data, loading } = useApp(appKey);
const app = data?.data || {};
const { appConfig } = useAppConfig(appKey);