refactor(web): rewrite mutation with DELETE /v1/connections/:connectionId

This commit is contained in:
Ali BARIN
2024-08-28 13:27:48 +00:00
parent c413ae06dc
commit 990e69143d
2 changed files with 28 additions and 16 deletions

View File

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