Am在coffeeScript
中请求更新数据库中的现有值。正在使用以下有效负载构成一个PUT
请求,并得到bad request error
。
请在下面找到我的有效载荷。
{
"thresholdValue":[
{
"businessTypeCode":"PARTS",
"businessTypeName":"parts",
"roleName":"System Admin",
"roleCode":"SYSTM_ADMIN",
"thresholdValue":"123"
},
{
"businessTypeCode":"PARTS",
"businessTypeName":"parts",
"roleName":"Dealer (Read-only)",
"roleCode":"DLR_RD_ONLY",
"thresholdValue":100
},
{
"businessTypeCode":"PARTS",
"businessTypeName":"parts",
"roleName":"Dealer",
"roleCode":"DLR",
"thresholdValue":100
}
]
}
userDeactivationThresholdService.coffeeScript
ThresholdValue = $resource('userThresholdValues/update-threshold-value', {},{usage:{method:'PUT'}})
updateThresholdValue: (updatedThresholdValue, onSuccess) ->
console.log("Update Threshold Values in Service")
console.log(updatedThresholdValue)
ThresholdValue.usage({thresholdValue: updatedThresholdValue}, onSuccess)
请找到我的控制器类文件(coffeeScript)
$scope.saveChanges = ->
console.log("update threshold values")
console.log($scope.thresholdValue)
return if !$scope.userDeactivationThresholdForm.$valid
$scope.editingInProgress = false
userDeactivationThresholdService.updateThresholdValue($scope.thresholdValue, thresholdValueUpdatedSuccessfully)
我正在获得400 bad request error
。