iachat/app/javascript/dashboard/routes/dashboard/contacts/routes.js
Sivin Varghese cd6c9a8fe9
enhancement: Custom views (#3838)
* enhancement: Custom views

* Review fixes
2022-01-27 08:26:12 +05:30

41 lines
1.2 KiB
JavaScript

/* eslint arrow-body-style: 0 */
import ContactsView from './components/ContactsView';
import ContactManageView from './pages/ContactManageView';
import { frontendURL } from '../../../helper/URLHelper';
export const routes = [
{
path: frontendURL('accounts/:accountId/contacts'),
name: 'contacts_dashboard',
roles: ['administrator', 'agent'],
component: ContactsView,
},
{
path: frontendURL('accounts/:accountId/contacts/custom_view/:id'),
name: 'contacts_segments_dashboard',
roles: ['administrator', 'agent'],
component: ContactsView,
props: route => {
return { segmentsId: route.params.id };
},
},
{
path: frontendURL('accounts/:accountId/labels/:label/contacts'),
name: 'contacts_labels_dashboard',
roles: ['administrator', 'agent'],
component: ContactsView,
props: route => {
return { label: route.params.label };
},
},
{
path: frontendURL('accounts/:accountId/contacts/:contactId'),
name: 'contact_profile_dashboard',
roles: ['administrator', 'agent'],
component: ContactManageView,
props: route => {
return { contactId: route.params.contactId };
},
},
];