u
This commit is contained in:
@@ -18,8 +18,8 @@ import { PanelTile, PanelTileGrid } from 'dashgui/panels';
|
||||
import withNavigate from '../../components/withNavigate';
|
||||
import { backendErrorFrom } from '../../utils/backendError';
|
||||
import { notifyError } from '../../utils/notify';
|
||||
import { setLastDeliveryPath } from '../../automats';
|
||||
import supplierAutomat from '../../automats/supplierAutomat';
|
||||
import { setLastDeliveryPath } from '../../automats/navigationAutomat';
|
||||
import companyAutomat from '../../automats/companyAutomat';
|
||||
import { deliveryDraftAutomat } from '../../automats/deliveryEditorAutomat';
|
||||
import {
|
||||
GREEN_PANEL,
|
||||
@@ -109,7 +109,7 @@ class LieferungLieferantenPage extends PureComponent {
|
||||
async loadSuppliers() {
|
||||
this.setState({ status: 'loading', error: null });
|
||||
try {
|
||||
const list = await supplierAutomat.actions.load();
|
||||
const list = await companyAutomat.actions.loadSuppliers();
|
||||
if (this._cancelled) return;
|
||||
this.applySuppliers(list);
|
||||
} catch (err) {
|
||||
@@ -123,7 +123,7 @@ class LieferungLieferantenPage extends PureComponent {
|
||||
}
|
||||
|
||||
async refreshFromServer() {
|
||||
const list = await supplierAutomat.actions.reload();
|
||||
const list = await companyAutomat.actions.reloadSuppliers();
|
||||
if (this._cancelled) return;
|
||||
this.applySuppliers(list);
|
||||
}
|
||||
@@ -136,7 +136,7 @@ class LieferungLieferantenPage extends PureComponent {
|
||||
|
||||
this.setState({ busyKey: 'new' });
|
||||
try {
|
||||
const newSupplier = await supplierAutomat.actions.create({ name });
|
||||
const newSupplier = await companyAutomat.actions.createSupplier({ name });
|
||||
|
||||
// Assign the new supplier to the active delivery draft & clear unmatched name
|
||||
deliveryDraftAutomat.actions.setDeliveryEntity(newSupplier.id);
|
||||
@@ -170,7 +170,7 @@ class LieferungLieferantenPage extends PureComponent {
|
||||
|
||||
this.setState({ busyKey: supplier.id });
|
||||
try {
|
||||
await supplierAutomat.actions.update(supplier.id, { name: draft });
|
||||
await companyAutomat.actions.updateSupplier(supplier.id, { name: draft });
|
||||
await this.refreshFromServer();
|
||||
if (this._cancelled) return;
|
||||
this.setState({ busyKey: null });
|
||||
@@ -193,7 +193,7 @@ class LieferungLieferantenPage extends PureComponent {
|
||||
|
||||
this.setState({ busyKey: supplier.id });
|
||||
try {
|
||||
await supplierAutomat.actions.remove(supplier.id);
|
||||
await companyAutomat.actions.removeSupplier(supplier.id);
|
||||
await this.refreshFromServer();
|
||||
if (this._cancelled) return;
|
||||
this.setState({ busyKey: null });
|
||||
|
||||
Reference in New Issue
Block a user