for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
var deptData = null;
function getRoleDone(jqXHR)
{
if(jqXHR.status !== 200 || jqXHR.responseJSON === undefined)
alert('Unable to obtain roles!');
return;
}
console.log(jqXHR);
console.log
function getDepartmentDone(jqXHR)
alert('Unable to obtain department!');
var data = jqXHR.responseJSON;
deptData = data[0];
$('#departmentNameRO').append(deptData.departmentName);
$('#departmentName').val(deptData.departmentName);
if(deptData.description !== undefined)
$('#description').val(deptData.description);
if(deptData.public)
$('#public').prop('checked', true);
$('#privateDept').hide();
$.ajax({
url: 'api/v1/departments/'+deptData.departmentID+'/roles',
type: 'GET',
dataType: 'json',
complete: getRoleDone});
function publicChanged()
if($('#public').prop('checked'))
else
$('#privateDept').show();
function viewShifts()
window.location = 'shifts.php?id='+deptData.departmentID;
return false;
function initPage()
var id = getParameterByName('id');
if(id === null)
url: 'api/v1/departments?$top=1',
complete: getDepartmentDone});
url: 'api/v1/departments/'+id,
$(initPage);