u
This commit is contained in:
@@ -15,7 +15,7 @@ import ListItemButton from '@mui/material/ListItemButton';
|
||||
import ListItemText from '@mui/material/ListItemText';
|
||||
import TextInput from '../TextInput';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import unitAutomat from '../../automats/unitAutomat';
|
||||
import companyAutomat from '../../automats/companyAutomat';
|
||||
import { unit as unitApi } from '../../api';
|
||||
import { requireObject } from '../../utils/apiShape';
|
||||
import { notifyError } from '../../utils/notify';
|
||||
@@ -85,7 +85,7 @@ export default class ArticleUnitEditorDialog extends Component {
|
||||
async loadUnits() {
|
||||
this.setState({ unitsLoading: true });
|
||||
try {
|
||||
const units = await unitAutomat.actions.load();
|
||||
const units = await companyAutomat.actions.loadUnits();
|
||||
this.setState({ units, unitsLoading: false });
|
||||
} catch (err) {
|
||||
this.setState({ unitsLoading: false });
|
||||
@@ -125,7 +125,7 @@ export default class ArticleUnitEditorDialog extends Component {
|
||||
});
|
||||
requireObject(data, 'PUT /api/unit');
|
||||
requireObject(data.unit, 'unit');
|
||||
const units = await unitAutomat.actions.load();
|
||||
const units = await companyAutomat.actions.loadUnits();
|
||||
this.setState({
|
||||
busy: false,
|
||||
units,
|
||||
@@ -145,7 +145,7 @@ export default class ArticleUnitEditorDialog extends Component {
|
||||
this.setState({ busy: true });
|
||||
try {
|
||||
await unitApi.delete(selectedSi);
|
||||
const units = await unitAutomat.actions.load();
|
||||
const units = await companyAutomat.actions.loadUnits();
|
||||
this.setState({ busy: false, units, form: emptyForm(), selectedSi: null });
|
||||
this.props.onUnitDeleted?.(selectedSi);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user