diff options
Diffstat (limited to 'frontend/views/index')
| -rw-r--r-- | frontend/views/index/components/graph.form.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/frontend/views/index/components/graph.form.js b/frontend/views/index/components/graph.form.js index 50f9773..d90b663 100644 --- a/frontend/views/index/components/graph.form.js +++ b/frontend/views/index/components/graph.form.js @@ -41,11 +41,15 @@ export default class GraphForm extends Component { if (errorFields.has(name)) { errorFields.delete(name) } + let sanitizedValue = value + if (name === 'path') { + sanitizedValue = sanitizedValue.toLowerCase().replace(/ /, '-').replace(/[!@#$%^&*()[\]{}]/, '-').replace(/-+/, '-') + } this.setState({ errorFields, data: { ...this.state.data, - [name]: value, + [name]: sanitizedValue, } }) } |
