2025-01-23 19:41:31 +03:00
|
|
|
import { useMutation } from '@tanstack/react-query';
|
|
|
|
|
|
|
|
import { ossApi } from './api';
|
|
|
|
|
|
|
|
export const useFindPredecessor = () => {
|
|
|
|
const mutation = useMutation({
|
|
|
|
mutationKey: [ossApi.baseKey, 'find-predecessor'],
|
|
|
|
mutationFn: ossApi.getPredecessor
|
|
|
|
});
|
|
|
|
return {
|
2025-02-17 14:31:17 +03:00
|
|
|
findPredecessor: (target: number) => mutation.mutateAsync({ target: target })
|
2025-01-23 19:41:31 +03:00
|
|
|
};
|
|
|
|
};
|