diff options
Diffstat (limited to 'src/containers/Service/ServiceList.tsx')
-rw-r--r-- | src/containers/Service/ServiceList.tsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/containers/Service/ServiceList.tsx b/src/containers/Service/ServiceList.tsx index b7054eb..7d30c14 100644 --- a/src/containers/Service/ServiceList.tsx +++ b/src/containers/Service/ServiceList.tsx @@ -11,7 +11,15 @@ const ServiceList: React.FC = () => { const history = useHistory(); const { data } = hooks[service.route].useList(); - const actions = [{ name: 'Добавить', route: `/${service.route}/add` }]; + const actions = [ + ...( + service.actions?.map(action => ({ + ...action, + route: `/${service.route}/${action.route}`, + })) || [] + ), + { name: 'Добавить', route: `/${service.route}/add` }, + ]; const handleRowClick = (index: number) => { const item = data && data[index]; |