mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 16:24:18 +03:00
Quote nested API parameters in api.js
I sometimes have parameter names with a period (.) in them, to represent nested objects, e.g. containerobj.inner_param. The Javascript was throwing an error in the browsable API when interacting with those parameters.
This commit is contained in:
parent
b96a22011b
commit
4701f12c3e
|
@ -102,7 +102,7 @@ $(function () {
|
|||
var entry = entries[i]
|
||||
var paramKey = entry[0]
|
||||
var paramValue = entry[1]
|
||||
var $elem = $form.find('[name=' + paramKey + ']')
|
||||
var $elem = $form.find('[name="' + paramKey + '"]')
|
||||
var dataType = $elem.data('type') || 'string'
|
||||
|
||||
if (dataType === 'integer' && paramValue) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user