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) {
|
||||
throw new Error('No file part')
|
||||
}
|
||||
const notes = payload.notes.replace(/"/g, '\\"')
|
||||
const form = new FormData()
|
||||
form.append('file', payload.file)
|
||||
form.append(
|
||||
'data',
|
||||
`{"sport_id": ${payload.sport_id}, "notes": "${payload.notes}"}`
|
||||
`{"sport_id": ${payload.sport_id}, "notes": "${notes}"}`
|
||||
)
|
||||
authApi
|
||||
.post('workouts', form, {
|
||||
|
Loading…
Reference in New Issue
Block a user