Update handleSubmit to only send workspace in properties if a new config
parent
ce39c0a7b5
commit
2ed842c085
|
@ -6,6 +6,8 @@ import {ErrorHandling} from 'src/shared/decorators/errors'
|
|||
interface Properties {
|
||||
channel: string
|
||||
url: string
|
||||
workspace?: string
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
interface Config {
|
||||
|
@ -143,11 +145,13 @@ class SlackConfig extends PureComponent<Props, State> {
|
|||
private handleSubmit = async e => {
|
||||
const {isNewConfig} = this.props
|
||||
e.preventDefault()
|
||||
const properties = {
|
||||
const properties: Properties = {
|
||||
url: this.url.value,
|
||||
channel: this.channel.value,
|
||||
enabled: this.state.enabled,
|
||||
workspace: this.workspace.value,
|
||||
}
|
||||
if (isNewConfig) {
|
||||
properties.workspace = this.workspace.value
|
||||
}
|
||||
const success = await this.props.onSave(properties, isNewConfig)
|
||||
if (success) {
|
||||
|
|
Loading…
Reference in New Issue