feat: use REST API endpoint to delete step
This commit is contained in:
14
packages/web/src/hooks/useDeleteStep.js
Normal file
14
packages/web/src/hooks/useDeleteStep.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import api from 'helpers/api';
|
||||
|
||||
export default function useDeleteStep() {
|
||||
const query = useMutation({
|
||||
mutationFn: async (stepId) => {
|
||||
const { data } = await api.delete(`/v1/steps/${stepId}`);
|
||||
|
||||
return data;
|
||||
},
|
||||
});
|
||||
|
||||
return query;
|
||||
}
|
Reference in New Issue
Block a user