Single Form için Button Navigate hataları
This commit is contained in:
parent
caf9927976
commit
61af16d0b5
1 changed files with 5 additions and 4 deletions
|
|
@ -10,6 +10,7 @@ import { useToolbar } from '../list/useToolbar'
|
||||||
import { PermissionResults, RowMode } from './types'
|
import { PermissionResults, RowMode } from './types'
|
||||||
import { GridDto } from '@/proxy/form/models'
|
import { GridDto } from '@/proxy/form/models'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import { ROUTES_ENUM } from '@/routes/route.constant'
|
||||||
|
|
||||||
const FormButtons = (props: {
|
const FormButtons = (props: {
|
||||||
mode: RowMode
|
mode: RowMode
|
||||||
|
|
@ -74,7 +75,7 @@ const FormButtons = (props: {
|
||||||
if (props.onActionNew) {
|
if (props.onActionNew) {
|
||||||
props.onActionNew()
|
props.onActionNew()
|
||||||
} else {
|
} else {
|
||||||
navigate(`/form/${listFormCode}`)
|
navigate(ROUTES_ENUM.protected.admin.formNew.replace(':formCode', listFormCode))
|
||||||
}
|
}
|
||||||
toast.push(
|
toast.push(
|
||||||
<Notification type="success" duration={2000}>
|
<Notification type="success" duration={2000}>
|
||||||
|
|
@ -182,7 +183,7 @@ const FormButtons = (props: {
|
||||||
if (onActionNew) {
|
if (onActionNew) {
|
||||||
onActionNew()
|
onActionNew()
|
||||||
} else {
|
} else {
|
||||||
navigate(`/form/${listFormCode}`)
|
navigate(ROUTES_ENUM.protected.admin.formNew.replace(':listFormCode', listFormCode))
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
{...(permissions.c ? {} : { disabled: true })}
|
{...(permissions.c ? {} : { disabled: true })}
|
||||||
|
|
@ -199,7 +200,7 @@ const FormButtons = (props: {
|
||||||
if (onActionEdit) {
|
if (onActionEdit) {
|
||||||
onActionEdit()
|
onActionEdit()
|
||||||
} else {
|
} else {
|
||||||
navigate(`edit`)
|
navigate(ROUTES_ENUM.protected.admin.formEdit.replace(':listFormCode', listFormCode).replace(':id', id!))
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
{...(permissions.u ? {} : { disabled: true })}
|
{...(permissions.u ? {} : { disabled: true })}
|
||||||
|
|
@ -216,7 +217,7 @@ const FormButtons = (props: {
|
||||||
if (onActionView) {
|
if (onActionView) {
|
||||||
onActionView()
|
onActionView()
|
||||||
} else {
|
} else {
|
||||||
navigate(`/form/${listFormCode}/${id}`)
|
navigate(ROUTES_ENUM.protected.admin.formView.replace(':listFormCode', listFormCode).replace(':id', id!))
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
{...(permissions.r ? {} : { disabled: true })}
|
{...(permissions.r ? {} : { disabled: true })}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue