u
This commit is contained in:
@@ -98,8 +98,7 @@ export default class BookDeliveryDialog extends PureComponent {
|
||||
loadSupplierArticlesIfNeeded() {
|
||||
const supplierId = this.props.delivery?.supplierId ?? this.props.delivery?.partyId;
|
||||
if (supplierId && Object.keys(this.state.supplierArticlesMap).length === 0) {
|
||||
void supplierApi.getArticles(supplierId).then((res) => {
|
||||
const articles = res?.articles || res?.supplier?.articles || [];
|
||||
void companyAutomat.actions.loadArticlesForSupplier(supplierId).then((articles) => {
|
||||
const map = buildSupplierArticlesMap(articles);
|
||||
this.setState({ supplierArticlesMap: map });
|
||||
}).catch(() => { });
|
||||
@@ -122,7 +121,6 @@ export default class BookDeliveryDialog extends PureComponent {
|
||||
this.unsubArticle = artikelAutomat.subscribe(() => {
|
||||
this.forceUpdate();
|
||||
});
|
||||
void companyAutomat.actions.loadWarehouses().catch(() => { });
|
||||
this.loadSupplierArticlesIfNeeded();
|
||||
|
||||
if (this.props.open) {
|
||||
@@ -225,7 +223,6 @@ export default class BookDeliveryDialog extends PureComponent {
|
||||
supplierArticlesMap: currentSupplierMap,
|
||||
},
|
||||
() => {
|
||||
void companyAutomat.actions.loadWarehouses().catch(() => { });
|
||||
this.loadSupplierArticlesIfNeeded();
|
||||
if (this.props.summary) {
|
||||
this.initAmountsFromSummary(this.props.summary, this.props.prefillLineId);
|
||||
|
||||
@@ -242,10 +242,6 @@ class ManifestForm extends PureComponent {
|
||||
['current', 'suppliers', 'suppliersStatus', 'customergroups', 'customergroupsStatus'],
|
||||
);
|
||||
|
||||
if (companyAutomat.state.warehousesStatus === 'idle') {
|
||||
void companyAutomat.actions.loadWarehouses();
|
||||
}
|
||||
|
||||
if (this.props.mode === 'edit') {
|
||||
void this.loadEdit();
|
||||
if (this.props.kind === 'order' || this.props.kind === 'retoure') {
|
||||
|
||||
Reference in New Issue
Block a user