Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async deleteBulk () {
const selectedIds = (Object.keys(this.state.selected)).map(v => Number.parseInt(v))
const res = await this.props.reportStore.deleteReports(selectedIds)
if (res && typeof res.deleted === 'number') {
toaster.success(`Deleted ${res.deleted} reports.`)
this.props.reportStore.fetchReports(
this.state.ordering, this.state.sort, this.state.page, this.state.projectId)
}
}
private handleKeyDown({
keyCode,
currentTarget,
}: React.KeyboardEvent): void {
if (KeyUtils.isEnterKey(keyCode)) {
const { onKeyDown } = this.props
const { value } = currentTarget
if (value === '') {
return
}
onKeyDown(value)
currentTarget.value = ''
toaster.success('Success to add', { duration: 1 })
}
}
}