var userid = _spPageContextInfo.userId;
var item = {
'__metadata': { 'type': $scope.ppguaSectionDocumentsItemType },
'ApprovalStatus': 'Rejected',
'AssignedToId': userid,
'Stage': $scope.currentStage
};
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('" + ListName + "')/items(" + ItemID + ")",
type: "POST",
contentType: "application/json;odata=verbose",
data: JSON.stringify(item),
headers: {
"Accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"X-HTTP-Method": "MERGE",
"If-Match": "*"
},
success: function (data) {
//alert(data.d.ID);
console.log('Section stage updated');
},
error: function (data) {
alert("Error");
}
});
No comments:
Post a Comment