feat(useAuthenticateApp): use REST API endpoint to create auth url

This commit is contained in:
Ali BARIN
2024-09-24 09:28:17 +00:00
parent 01407cf040
commit 7dcfb1081b
4 changed files with 27 additions and 8 deletions

View File

@@ -0,0 +1,17 @@
import { useMutation } from '@tanstack/react-query';
import api from 'helpers/api';
export default function useCreateConnectionAuthUrl() {
const query = useMutation({
mutationFn: async (connectionId) => {
const { data } = await api.post(
`/v1/connections/${connectionId}/auth-url`,
);
return data;
},
});
return query;
}