haskell-servant/servant-js

Change of requestBody not honoured in JQuery 'data:' generation

Opened this issue · 0 comments

Hi, when using
jqueryWith $ defCommonGeneratorOptions {requestBody = "payload"}
generated JS is this

var postUsers = function(payload, onSuccess, onError)   /// changed
{
  $.ajax(
    { url: '/api/users'
    , success: onSuccess
    , data: JSON.stringify(body)   /// not changed
    , contentType: 'application/json'
    , error: onError
    , type: 'POST'
    });
}