migrate to blitzjs

This commit is contained in:
m5r
2021-07-31 22:33:18 +08:00
parent 4aa646ab43
commit fc4278ca7b
218 changed files with 19100 additions and 27038 deletions

View File

@ -0,0 +1,15 @@
import { useQuery } from "blitz"
import useCurrentCustomer from "../../core/hooks/use-current-customer"
import getPhoneCalls from "../queries/get-phone-calls"
export default function usePhoneCalls() {
const { customer } = useCurrentCustomer()
if (!customer) {
throw new Error("customer not found")
}
const { phoneCalls } = useQuery(getPhoneCalls, { customerId: customer.id })[0]
return phoneCalls
}