refactor(web): rewrite useAdminAppAuthClient with react-query (#1690)

This commit is contained in:
Rıdvan Akca
2024-03-04 15:09:42 +03:00
committed by GitHub
parent 690832052a
commit bfc7d5d0dd
2 changed files with 44 additions and 14 deletions

View File

@@ -0,0 +1,17 @@
import { useQuery } from '@tanstack/react-query';
import api from 'helpers/api';
export default function useAdminAppAuthClient(id) {
const query = useQuery({
queryKey: ['adminAppAuthClient', id],
queryFn: async ({ payload, signal }) => {
const { data } = await api.get(`/v1/admin/app-auth-clients/${id}`);
return data;
},
enabled: !!id,
});
return query;
}