Updated categories page
Deploy Frontend / build-and-deploy (push) Successful in 32s Details

This commit is contained in:
romanskijdev 2026-11-18 15:35:10 +03:00
parent f7ca74a7b5
commit a2cec7e2a3
2 changed files with 12 additions and 2 deletions

View File

@ -5,7 +5,7 @@ import { IconPencil, IconPlus, IconSearch, IconTrash } from '@tabler/icons-react
import { useCategories, useDeleteCategory } from '@/features/categories/hooks/useCategories'
import { ApprovalTopicCategory } from '@/src/types/api'
import { ApprovalTopicCategory } from '@/types/api'
import { PageHeader } from '@/components/ui/PageHeader'
import { FilterBar } from '@/components/ui/FilterBar'
import { DataTable, type Column } from '@/components/ui/DataTable'

View File

@ -177,9 +177,19 @@ export default function HierarchiesPage() {
try {
await Promise.all(
group.steps.map((step) =>
updateHierarchy.mutateAsync({ ...step, target_system: targetSystem })
updateHierarchy.mutateAsync({
id: step.id!,
subordinate_id: step.subordinate_id!,
approver_id: step.approver_id!,
department_id: step.department_id!,
topic_category_id: step.topic_category_id ?? null,
topic_id: step.topic_id ?? null,
priority: step.priority ?? 0,
target_system: targetSystem,
})
)
)
await queryClient.invalidateQueries({ queryKey: [HIERARCHIES_QUERY_KEY] })
} catch (error) {
notifications.show({ title: 'Ошибка', message: 'Не удалось обновить систему', color: 'red' })
}