Client - escape double quotes in notes when adding workout w/ gpx
This commit is contained in:
parent
6cf192bd25
commit
17bd7c166e
@ -185,11 +185,12 @@ export const actions: ActionTree<IWorkoutsState, IRootState> &
|
|||||||
if (!payload.file) {
|
if (!payload.file) {
|
||||||
throw new Error('No file part')
|
throw new Error('No file part')
|
||||||
}
|
}
|
||||||
|
const notes = payload.notes.replace(/"/g, '\\"')
|
||||||
const form = new FormData()
|
const form = new FormData()
|
||||||
form.append('file', payload.file)
|
form.append('file', payload.file)
|
||||||
form.append(
|
form.append(
|
||||||
'data',
|
'data',
|
||||||
`{"sport_id": ${payload.sport_id}, "notes": "${payload.notes}"}`
|
`{"sport_id": ${payload.sport_id}, "notes": "${notes}"}`
|
||||||
)
|
)
|
||||||
authApi
|
authApi
|
||||||
.post('workouts', form, {
|
.post('workouts', form, {
|
||||||
|
Loading…
Reference in New Issue
Block a user