Skip to main content

Interface: UseCompanyReturn

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

State and company actions returned by useCompany.

Properties​

acceptCartRequest​

acceptCartRequest: (cartId) => Promise<{ error?: string; success: boolean; }>

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

Accepts a cart's pending purchase-authorization request.

Parameters​

cartId​

string

Returns​

Promise<{ error?: string; success: boolean; }>


company​

company: Company | null

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

The fetched company, or null.


createPac​

createPac: (input) => Promise<{ error?: string; success: boolean; }>

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

Creates a Purchase Authorization Config (PAC).

Parameters​

input​

PurchaseAuthorizationConfigCreateInput

Returns​

Promise<{ error?: string; success: boolean; }>


deletePac​

deletePac: (pacId) => Promise<{ error?: string; success: boolean; }>

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

Deletes a PAC by id.

Parameters​

pacId​

string

Returns​

Promise<{ error?: string; success: boolean; }>


error​

error: string | null

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

Last error message, or null.


fetchCompany​

fetchCompany: (companyId, overrides?) => Promise<void>

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

Fetches a company by id, optionally overriding the default search/PA-config inputs.

Parameters​

companyId​

number

overrides?​

Partial<Omit<CompanyVariables, "id">>

Returns​

Promise<void>


fetchPendingCarts​

fetchPendingCarts: (companyId) => Promise<void>

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

Loads carts pending purchase authorization for the company.

Parameters​

companyId​

number

Returns​

Promise<void>


loading​

loading: boolean

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

true while a fetch is in flight.


pendingCarts​

pendingCarts: Cart[]

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

Carts awaiting purchase authorization for the company.


updatePac​

updatePac: (pacId, input) => Promise<{ error?: string; success: boolean; }>

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

Updates an existing PAC by id.

Parameters​

pacId​

string

input​

PurchaseAuthorizationConfigUpdateInput

Returns​

Promise<{ error?: string; success: boolean; }>