mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
Update AdminPaymentMethods.tsx
This commit is contained in:
@@ -610,6 +610,9 @@ export default function AdminPaymentMethods() {
|
|||||||
queryClient.invalidateQueries({ queryKey: ['admin-payment-methods'] })
|
queryClient.invalidateQueries({ queryKey: ['admin-payment-methods'] })
|
||||||
setToastMessage(t('admin.paymentMethods.orderSaved', 'Порядок сохранён'))
|
setToastMessage(t('admin.paymentMethods.orderSaved', 'Порядок сохранён'))
|
||||||
},
|
},
|
||||||
|
onError: () => {
|
||||||
|
setToastMessage(t('common.error', 'Ошибка'))
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// Update method mutation
|
// Update method mutation
|
||||||
@@ -621,6 +624,9 @@ export default function AdminPaymentMethods() {
|
|||||||
setSelectedMethod(null)
|
setSelectedMethod(null)
|
||||||
setToastMessage(t('admin.paymentMethods.saved', 'Настройки сохранены'))
|
setToastMessage(t('admin.paymentMethods.saved', 'Настройки сохранены'))
|
||||||
},
|
},
|
||||||
|
onError: () => {
|
||||||
|
setToastMessage(t('common.error', 'Ошибка'))
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// DnD sensors
|
// DnD sensors
|
||||||
@@ -636,6 +642,7 @@ export default function AdminPaymentMethods() {
|
|||||||
setMethods(prev => {
|
setMethods(prev => {
|
||||||
const oldIndex = prev.findIndex(m => m.method_id === active.id)
|
const oldIndex = prev.findIndex(m => m.method_id === active.id)
|
||||||
const newIndex = prev.findIndex(m => m.method_id === over.id)
|
const newIndex = prev.findIndex(m => m.method_id === over.id)
|
||||||
|
if (oldIndex === -1 || newIndex === -1) return prev
|
||||||
return arrayMove(prev, oldIndex, newIndex)
|
return arrayMove(prev, oldIndex, newIndex)
|
||||||
})
|
})
|
||||||
setOrderChanged(true)
|
setOrderChanged(true)
|
||||||
|
|||||||
Reference in New Issue
Block a user