MSP-3289 add initial value for app modal form
This commit is contained in:
1 parent
f20b30636c
commit
68f563e826
3 files changed
+28
-7
No files matched your search
@@ -12,8 +12,8 @@ import Modal from '@widgets/Modal'
|
||||
import ApplicationsContent from '@components/ApplicationsContent'
|
||||
|
||||
import {
|
||||
NewApplicationsGroupType,
|
||||
ApplicationsGroupType,
|
||||
NewApplicationsGroupType,
|
||||
UpdateApplicationsGroupType
|
||||
} from '@pages/ApplicationsPage/applications.type.ts'
|
||||
|
||||
@@ -73,6 +73,15 @@ const ApplicationsPage = () => {
|
||||
mode: 'onChange'
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
const currentItem = applicationsGroup.find(
|
||||
(group) => group.id.toString() === selectedItemId
|
||||
)
|
||||
if (currentItem) {
|
||||
reset(currentItem)
|
||||
}
|
||||
}, [selectedItemId,applicationsGroup])
|
||||
|
||||
if (isErrorApplicationsGroup) {
|
||||
return <EmptyData />
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user