Skip to main content

Crm Users

A shared package that exports queries, mutations, types, and utility functions for crm users.

Usage​

The module has been imported into our root npm package. All you have to do is import it into your module.

import { CrmUser } from '@shared/crm-users'

Exported Queries​

useCrmUsersQuery​

Fetches a paginated list of crm users from the public-api crm_users endpoint. You are able to pass an optional set of query params and optionally override the underlying UseQueryOptions.

const { data, isLoading } = useCrmUsersQuery(queryParams)

useInfiniteCrmUsersQuery​

Fetches a paginated list of crm users from the public-api crm_users endpoint. You are able to pass an optional set of query params and optionally override the underlying UseInfiniteQueryOptions. This hook should be used for components that require infinite scrolling.

const { data, isLoading, fetchNextPage, hasNextPage } =
useInfiniteCrmUsersQuery(queryParams)

getCrmUsers​

Fetches a paginated list of crm users from the public-api crm_users endpoint. You are able to pass an optional set of query params and optionally override the underlying UseQueryOptions.

const { data } = getCrmUsers(queryParams)

invalidateCrmUsers​

Function that invalidates crm users query

invalidateCrmUsers()

Exported Types​

| Type      | Description                                    |
| --------- | ---------------------------------------------- |
| `CrmUser` | `CrmUser resource returned by our public apis` |