All files / app/src/entities/property/model delete-property-value-query.ts

25% Statements 2/8
100% Branches 0/0
0% Functions 0/1
25% Lines 2/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 141x         1x                
import { queryDeletePropertyValue } from './requests'
import { useMutation, UseMutationOptions } from 'react-query'
import { AxiosError, AxiosRequestConfig } from 'axios'
import { DELETE_PROPERTY_PRIMARY_KEY } from '../lib'
 
export const useDeleteProperty = (
  options?: Omit<UseMutationOptions<{ id: string }, AxiosError, { id: string }>, 'mutationFn'>,
  config?: AxiosRequestConfig
) =>
  useMutation(({ id }) => queryDeletePropertyValue(id)({ ...config })(), {
    ...options,
    mutationKey: DELETE_PROPERTY_PRIMARY_KEY,
  })