MSP-3325 add message.error and navigate in ApplicationsPage, ApplicationsContent and ModulesPage

This commit is contained in:
Anastasiia committed 2024-05-28 14:57:32 +07:00
1 parent 759f432e6c
commit 039120aec0
3 files changed
+14 -7

No files matched your search

+8 -5
View File
@@ -120,17 +120,20 @@ const ApplicationsContent: FC<ApplicationsContentPropTypes> = ({
createApplicationService(newApplicationApp)
.unwrap()
.then(message.success('Элемент сохранен'))
.catch((e) => message.error(e))
setShowApplicationsModal({
.then(() => message.success('Элемент сохранен'))
.catch(() => message.error('Ошибка добавления элемента')).finally(()=> setShowApplicationsModal({
...showApplicationsModal,
addModal: false
})
}))
}
const handleRemoveApplicationApp = (id: number) =>
removeApplicationsService([id])
.unwrap()
.then(() => message.success('Элемент удален'))
.then(() => {
message.success('Элемент удален')
navigate(`${routePaths.applicationsGroup}/${selectedItemId}/${routePaths.application}`)
})
.catch(() => message.error('Ошибка удаления элемента'))
const renderColumnItems = (item: ColumnItem<any>) => {