feat(admin): Control Center redesign, Explore dual-view и полный RU/EN i18n
Refs EventHub/EventHubFrontAdmin#32
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { eventsApi } from '../api/eventsApi';
|
||||
import { Event, EventListParams } from '../types/api';
|
||||
import { message } from 'antd';
|
||||
import { notify } from '@/lib/notify';
|
||||
import i18n from '@/i18n';
|
||||
import { normalizeData } from '../utils/normalize';
|
||||
|
||||
export const useEvents = (params: EventListParams) => {
|
||||
@@ -29,9 +30,9 @@ export const useUpdateEvent = () => {
|
||||
eventsApi.updateEvent(id, data),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['events'] });
|
||||
message.success('Событие обновлено');
|
||||
notify.success(i18n.t('common.entityUpdated'));
|
||||
},
|
||||
onError: () => message.error('Ошибка обновления'),
|
||||
onError: () => notify.error(i18n.t('common.updateError')),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -41,9 +42,9 @@ export const useDeleteEvent = () => {
|
||||
mutationFn: (id: string) => eventsApi.deleteEvent(id),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['events'] });
|
||||
message.success('Событие удалено');
|
||||
notify.success(i18n.t('common.entityDeleted'));
|
||||
},
|
||||
onError: () => message.error('Ошибка удаления'),
|
||||
onError: () => notify.error(i18n.t('common.deleteError')),
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user