|
|
|
@ -71,9 +71,9 @@ function Management() {
|
|
|
|
|
const [currentTravelAgency, setCurrentTravelAgency] = useState(null)
|
|
|
|
|
|
|
|
|
|
const [accountForm] = Form.useForm()
|
|
|
|
|
const [searchAccountByCriteria, accountList, toggleAccountStatus, saveOrUpdateAccount, resetAccountPassword] =
|
|
|
|
|
const [searchAccountByCriteria, accountList, toggleAccountStatus, saveOrUpdateAccount, resetAccountPassword, newEmptyAccount] =
|
|
|
|
|
useAccountStore((state) =>
|
|
|
|
|
[state.searchAccountByCriteria, state.accountList, state.toggleAccountStatus, state.saveOrUpdateAccount, state.resetAccountPassword])
|
|
|
|
|
[state.searchAccountByCriteria, state.accountList, state.toggleAccountStatus, state.saveOrUpdateAccount, state.resetAccountPassword, state.newEmptyAccount])
|
|
|
|
|
|
|
|
|
|
const formValues = useFormStore(state => state.formValues)
|
|
|
|
|
const { notification, modal } = App.useApp()
|
|
|
|
@ -117,6 +117,12 @@ function Management() {
|
|
|
|
|
setAccountModalOpen(true)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const onNewAccount = () => {
|
|
|
|
|
const emptyAccount = newEmptyAccount()
|
|
|
|
|
accountForm.setFieldsValue(emptyAccount)
|
|
|
|
|
setAccountModalOpen(true)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const onAccountFinish = (values) => {
|
|
|
|
|
saveOrUpdateAccount(values)
|
|
|
|
|
.then(() => {
|
|
|
|
@ -331,7 +337,7 @@ function Management() {
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
<Space>
|
|
|
|
|
<Button onClick={() => setAccountModalOpen(true)}>{t('account:newAccount')}</Button>
|
|
|
|
|
<Button onClick={() => onNewAccount()}>{t('account:newAccount')}</Button>
|
|
|
|
|
</Space>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|