shellphone.app/app/phone-calls/hooks/use-phone-calls.ts

11 lines
392 B
TypeScript
Raw Normal View History

import { NotFoundError, useQuery } from "blitz";
2021-07-31 14:33:18 +00:00
2021-08-05 17:07:15 +00:00
import useCurrentPhoneNumber from "../..//core/hooks/use-current-phone-number";
import getPhoneCalls from "../queries/get-phone-calls";
2021-07-31 14:33:18 +00:00
export default function usePhoneCalls() {
2021-08-05 17:07:15 +00:00
const phoneNumber = useCurrentPhoneNumber();
2021-07-31 14:33:18 +00:00
2021-10-15 22:24:28 +00:00
return useQuery(getPhoneCalls, { phoneNumberId: phoneNumber?.id as string }, { enabled: Boolean(phoneNumber) });
2021-07-31 14:33:18 +00:00
}