2025-01-23 19:41:31 +03:00
|
|
|
import { useMutation } from '@tanstack/react-query';
|
|
|
|
|
2025-02-11 20:15:34 +03:00
|
|
|
import { ITargetCst } from '@/features/rsform/models/rsform';
|
2025-01-23 19:41:31 +03:00
|
|
|
|
|
|
|
import { ossApi } from './api';
|
|
|
|
|
|
|
|
export const useFindPredecessor = () => {
|
|
|
|
const mutation = useMutation({
|
|
|
|
mutationKey: [ossApi.baseKey, 'find-predecessor'],
|
|
|
|
mutationFn: ossApi.getPredecessor
|
|
|
|
});
|
|
|
|
return {
|
2025-02-11 20:15:34 +03:00
|
|
|
findPredecessor: (data: ITargetCst) => mutation.mutateAsync(data)
|
2025-01-23 19:41:31 +03:00
|
|
|
};
|
|
|
|
};
|