u
This commit is contained in:
@@ -27,8 +27,7 @@ import TrendingDownIcon from '@mui/icons-material/TrendingDown';
|
||||
import TuneIcon from '@mui/icons-material/Tune';
|
||||
import Switch from '@mui/material/Switch';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import { stock, article as articleApi } from '../../api';
|
||||
import { StorageManagerContext } from '../../api/storageManagerContext';
|
||||
import { stock } from '../../api';
|
||||
import { formatStock } from './searchFormat';
|
||||
import { notifyError } from '../../utils/notify';
|
||||
import artikelAutomat from '../../automats/artikelAutomat';
|
||||
@@ -43,8 +42,6 @@ const REASON_PRESETS = [
|
||||
];
|
||||
|
||||
export default class ArticleStockAdjustDialog extends PureComponent {
|
||||
static contextType = StorageManagerContext;
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
const initialWhId = this.resolveInitialWarehouseId(props);
|
||||
@@ -214,9 +211,9 @@ export default class ArticleStockAdjustDialog extends PureComponent {
|
||||
|
||||
// 1. Update track_stock if changed
|
||||
if (trackStockChanged) {
|
||||
const store = this.context;
|
||||
const setFn = store?.article?.setTrackStock ?? articleApi.setTrackStock;
|
||||
const trackRes = await setFn(article.sku, { track_stock: trackStock });
|
||||
const trackRes = await artikelAutomat.actions.setTrackStock(article.sku, {
|
||||
track_stock: trackStock,
|
||||
});
|
||||
updatedArticle = trackRes?.article || null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user