We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed attempt:
async handleExpenseTypeChange(selected: any) { console.log('Handle'); let isNew = false let type = '' if (selected != null && selected.length === 1) { let selectedExpenseType = selected[0] isNew = (selectedExpenseType.id == null) if (! isNew) { this.setState({ selectedExpenseType: selected }) return } else { type = selectedExpenseType.type } } else { let input: any = ReactDOM.findDOMNode(this.refs.expenseTypeTypeahead.getInstance()).querySelector(`input[name=expenseType]`) if (input.value == null || input.value === '') { return } let existingType try { existingType = await getExpenseTypeByType(input.value) } catch (err) { console.error('Could not fetch expense type', err) return } isNew = (existingType == null) if (isNew) { type = input.value } } // if (selectedExpenseType.customOption && existingType == null) { // isNewExpenseType = true // } if (isNew) { let expenseType try { expenseType = await createExpenseType({ type }) } catch (err) { this.props.notify(t('Der Ausgabenstyp konnte nicht angelegt werden: ') + err, 'error') } this.setState({ selectedExpenseType: [expenseType], expenseTypeList: [expenseType].concat(this.state.expenseTypeList) }) } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Failed attempt:
The text was updated successfully, but these errors were encountered: