()
| 330 | } |
| 331 | |
| 332 | export function createCustomDomainQuery() { |
| 333 | return useQuery(() => ({ |
| 334 | queryKey: ["customDomain"] as const, |
| 335 | queryFn: async () => { |
| 336 | try { |
| 337 | const auth = await authStore.get(); |
| 338 | if (!auth) return { custom_domain: null, domain_verified: null }; |
| 339 | const response = await orgCustomDomainClient.getOrgCustomDomain({ |
| 340 | headers: await protectedHeaders(), |
| 341 | }); |
| 342 | if (response.status === 200) return response.body; |
| 343 | } catch (error) { |
| 344 | console.error("Error fetching custom domain:", error); |
| 345 | return { custom_domain: null, domain_verified: null }; |
| 346 | } |
| 347 | }, |
| 348 | refetchOnMount: true, |
| 349 | refetchOnWindowFocus: true, |
| 350 | })); |
| 351 | } |
| 352 | |
| 353 | export function createOrganizationsQuery() { |
| 354 | const auth = authStore.createQuery(); |
no test coverage detected