u
This commit is contained in:
@@ -6,7 +6,7 @@ import DeleteOutlinedIcon from '@mui/icons-material/DeleteOutlined';
|
||||
import DragIndicatorIcon from '@mui/icons-material/DragIndicator';
|
||||
import SingleLineTextEdit from 'dashgui/SingleLineTextEdit';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import warehouseAutomat from '../../automats/warehouseAutomat';
|
||||
import companyAutomat from '../../automats/companyAutomat';
|
||||
import { notifyError } from '../../utils/notify';
|
||||
|
||||
class ArtikelLager extends PureComponent {
|
||||
@@ -51,7 +51,7 @@ class ArtikelLager extends PureComponent {
|
||||
|
||||
async renameWarehouse(item, name) {
|
||||
try {
|
||||
await warehouseAutomat.actions.update(item.id, { name });
|
||||
await companyAutomat.actions.updateWarehouse(item.id, { name });
|
||||
enqueueSnackbar('Lager gespeichert.', { variant: 'success' });
|
||||
} catch (err) {
|
||||
this.setState({ draft: item.name ?? '' });
|
||||
@@ -78,7 +78,7 @@ class ArtikelLager extends PureComponent {
|
||||
if (!window.confirm(`Lager „${item.name}" wirklich löschen?`)) return;
|
||||
void (async () => {
|
||||
try {
|
||||
await warehouseAutomat.actions.remove(item.id);
|
||||
await companyAutomat.actions.removeWarehouse(item.id);
|
||||
enqueueSnackbar('Lager gelöscht.', { variant: 'success' });
|
||||
} catch (err) {
|
||||
notifyError(err);
|
||||
|
||||
Reference in New Issue
Block a user