Skip to main content

Function: useCompany()

useCompany(options): UseCompanyReturn

Defined in: composables/react/useCompany.ts:80

useCompany — company switcher and Purchase Authorization configurator.

Parameters

options

UseCompanyOptions

see UseCompanyOptions.

Returns

UseCompanyReturn

company state plus async actions — see UseCompanyReturn.

Remarks

GraphQL integration: services are built per-call via createServices(graphqlClient). fetchCompany calls services.company.getCompany() (CompanyService) with contactSearchArguments, contactPAConfigInput and companyAttributesInput. fetchPendingCarts and acceptCartRequest go through services.cart (CartService) — getCarts filtered by CartStatus.PENDING_PURCHASE_AUTHORIZATION, and acceptPurchaseAuthorizationRequest. PAC CRUD goes through services.purchaseAuthConfig (PurchaseAuthorizationConfigService) — createPurchaseAuthorizationConfig / updatePurchaseAuthorizationConfig / deletePurchaseAuthorizationConfig. All calls require an authenticated session; each method no-ops or returns { success: false } when graphqlClient is null.