Single Form için Button Navigate hataları

This commit is contained in:
Sedat Öztürk 2025-08-19 22:53:07 +03:00
parent caf9927976
commit 61af16d0b5

View file

@ -10,6 +10,7 @@ import { useToolbar } from '../list/useToolbar'
import { PermissionResults, RowMode } from './types'
import { GridDto } from '@/proxy/form/models'
import React from 'react'
import { ROUTES_ENUM } from '@/routes/route.constant'
const FormButtons = (props: {
mode: RowMode
@ -74,7 +75,7 @@ const FormButtons = (props: {
if (props.onActionNew) {
props.onActionNew()
} else {
navigate(`/form/${listFormCode}`)
navigate(ROUTES_ENUM.protected.admin.formNew.replace(':formCode', listFormCode))
}
toast.push(
<Notification type="success" duration={2000}>
@ -182,7 +183,7 @@ const FormButtons = (props: {
if (onActionNew) {
onActionNew()
} else {
navigate(`/form/${listFormCode}`)
navigate(ROUTES_ENUM.protected.admin.formNew.replace(':listFormCode', listFormCode))
}
}}
{...(permissions.c ? {} : { disabled: true })}
@ -199,7 +200,7 @@ const FormButtons = (props: {
if (onActionEdit) {
onActionEdit()
} else {
navigate(`edit`)
navigate(ROUTES_ENUM.protected.admin.formEdit.replace(':listFormCode', listFormCode).replace(':id', id!))
}
}}
{...(permissions.u ? {} : { disabled: true })}
@ -216,7 +217,7 @@ const FormButtons = (props: {
if (onActionView) {
onActionView()
} else {
navigate(`/form/${listFormCode}/${id}`)
navigate(ROUTES_ENUM.protected.admin.formView.replace(':listFormCode', listFormCode).replace(':id', id!))
}
}}
{...(permissions.r ? {} : { disabled: true })}