Remove unnecessary notistacks and dead terminal enable/disable code
- Remove 'Artikel angelegt.' snackbar from NewArticleTile - Remove 'Kategorie angelegt.' snackbar from NewCategoryTile - Remove dead handleEnableAllCategories method and binding from CompanySettingsDialog
This commit is contained in:
@@ -65,7 +65,6 @@ class CompanySettingsDialog extends Component {
|
||||
this.syncFormFromCompany = this.syncFormFromCompany.bind(this);
|
||||
this.handleCreateTerminal = this.handleCreateTerminal.bind(this);
|
||||
this.handleDeleteTerminal = this.handleDeleteTerminal.bind(this);
|
||||
this.handleEnableAllCategories = this.handleEnableAllCategories.bind(this);
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
@@ -131,21 +130,6 @@ class CompanySettingsDialog extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
async handleEnableAllCategories(terminal) {
|
||||
try {
|
||||
const hasCategories = terminal.categoryIds && terminal.categoryIds.length > 0;
|
||||
if (hasCategories) {
|
||||
await this.props.disableAllTerminalCategories({ terminalId: terminal.id }).unwrap();
|
||||
enqueueSnackbar('Alle Kategorien für Terminal deaktiviert.', { variant: 'success' });
|
||||
} else {
|
||||
await this.props.enableAllTerminalCategories({ terminalId: terminal.id }).unwrap();
|
||||
enqueueSnackbar('Alle Kategorien für Terminal aktiviert.', { variant: 'success' });
|
||||
}
|
||||
} catch (err) {
|
||||
notifyError(err);
|
||||
}
|
||||
}
|
||||
|
||||
async handleSubmit(event) {
|
||||
event.preventDefault();
|
||||
const { onClose } = this.props;
|
||||
|
||||
Reference in New Issue
Block a user