escape json

This commit is contained in:
Arnaud Delcasse
2025-10-08 23:54:53 +02:00
parent 878200058b
commit 80c40759bb
3 changed files with 17 additions and 17 deletions

View File

@@ -31,10 +31,10 @@
drivers: [
{{range $index, $driver := .ViewState.drivers}}{{if $index}},{{end}}{
id: '{{$driver.ID}}',
firstName: '{{$driver.Data.first_name}}',
lastName: '{{$driver.Data.last_name}}',
address: '{{if $driver.Data.address}}{{$driver.Data.address.properties.label}}{{end}}',
phoneNumber: '{{$driver.Data.phone_number}}',
firstName: '{{ jsEscape $driver.Data.first_name }}',
lastName: '{{ jsEscape $driver.Data.last_name }}',
address: '{{if $driver.Data.address}}{{ jsEscape $driver.Data.address.properties.label }}{{end}}',
phoneNumber: '{{ jsEscape $driver.Data.phone_number }}',
validated: {{if solidarityDriverValidatedProfile $driver (solidarityDocuments $driver.ID)}}true{{else}}false{{end}}
}{{end}}
],