20 lines
630 B
TypeScript
20 lines
630 B
TypeScript
import { useResponse } from '@/shared/components/response/ResponseContext';
|
|
import { useState } from 'react';
|
|
import TImovelInterface from '../../interfaces/TImovel/TImovelInterface';
|
|
import { TImovelDeleteService } from '../../services/TImovel/TImovelDeleteService';
|
|
|
|
export const useTImovelDeleteHook = () => {
|
|
const { setResponse } = useResponse();
|
|
|
|
const [tImovel, setTImovel] = useState<TImovelInterface>();
|
|
|
|
const deleteTImovel = async (data: TImovelInterface) => {
|
|
const response = await TImovelDeleteService(data);
|
|
|
|
setTImovel(data);
|
|
|
|
setResponse(response);
|
|
};
|
|
|
|
return { tImovel, deleteTImovel };
|
|
};
|