UNPKG

1.45 kBJavaScriptView Raw
1import {
2 avProvidersApi,
3 avOrganizationsApi,
4 avRegionsApi,
5 avPermissionsApi,
6 avNavigationApi,
7 avUserApi,
8 avCodesApi,
9} from '@availity/api-axios';
10import AvResourceSelect from './AvResourceSelect';
11
12const AvProviderSelect = AvResourceSelect.create({
13 resource: avProvidersApi,
14 labelKey: 'uiDisplayName',
15 requiredParams: ['customerId'],
16 watchParams: ['customerId'],
17});
18const AvOrganizationSelect = AvResourceSelect.create({
19 resource: avOrganizationsApi,
20 labelKey: 'name',
21});
22const AvRegionSelect = AvResourceSelect.create({
23 resource: avRegionsApi,
24 labelKey: 'value',
25 valueKey: 'id',
26});
27const AvPermissionSelect = AvResourceSelect.create({
28 resource: avPermissionsApi,
29 labelKey: 'description',
30 valueKey: 'id',
31});
32const AvNavigationSelect = AvResourceSelect.create({
33 resource: avNavigationApi,
34 labelKey: 'name',
35 valueKey: 'id',
36});
37const AvUserSelect = AvResourceSelect.create({
38 resource: avUserApi,
39 getOptionLabel: option =>
40 `${option.firstName} ${option.lastName} (${option.id}) - ${option.userId}`,
41});
42const AvCodeSelect = AvResourceSelect.create({
43 resource: avCodesApi,
44 valueKey: 'code',
45 getOptionLabel: option => `${option.code} - ${option.value}`,
46 requiredParams: ['list'],
47 watchParams: ['list'],
48});
49
50export default AvResourceSelect;
51export {
52 AvProviderSelect,
53 AvOrganizationSelect,
54 AvRegionSelect,
55 AvPermissionSelect,
56 AvNavigationSelect,
57 AvUserSelect,
58 AvCodeSelect,
59};