summaryrefslogtreecommitdiff
path: root/frontend/views/index/components/graph.form.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-06-02 20:41:58 +0200
committerJules Laplace <julescarbon@gmail.com>2020-06-02 20:41:58 +0200
commit7eab18f839616140fe3dbc4b51e29ec903c48077 (patch)
treec6f4160b7567904726f8036d2f5a2ef4d7846093 /frontend/views/index/components/graph.form.js
parent402dd17858076b6a0fac618de85614114dfe94fe (diff)
adding les pages
Diffstat (limited to 'frontend/views/index/components/graph.form.js')
-rw-r--r--frontend/views/index/components/graph.form.js6
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,
}
})
}