shellphone.app/app/phone-calls/hooks/use-phone-calls.ts
2021-10-16 00:31:01 +02:00

11 lines
392 B
TypeScript

import { NotFoundError, useQuery } from "blitz";
import useCurrentPhoneNumber from "../..//core/hooks/use-current-phone-number";
import getPhoneCalls from "../queries/get-phone-calls";
export default function usePhoneCalls() {
const phoneNumber = useCurrentPhoneNumber();
return useQuery(getPhoneCalls, { phoneNumberId: phoneNumber?.id as string }, { enabled: Boolean(phoneNumber) });
}