Skip to content

Commit

Permalink
Fix Issue nightscout#5763 - Change $.ajax to /api/v1/profile (nightsc…
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfoley authored Sep 8, 2020
1 parent 67fb939 commit d26091b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions static/profile/js/profileeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -681,12 +681,13 @@
// This is a crude way of preventing the user from changing the inputs whilst waiting.
// If the user was able to make changes, they'd be lost when the done callback redraws anyway.
$('#pe_form').hide();

var headers = client.headers();
headers['Content-Type'] = 'application/json';
$.ajax({
method: 'PUT'
, url: '/api/v1/profile/'
, data: adjustedRecord
, headers: client.headers()
, data: JSON.stringify(adjustedRecord)
, headers: headers
}).done(function postSuccess (data, status) {
console.info('profile saved', data);
$('#pe_form').show(); // allow edits again
Expand Down

0 comments on commit d26091b

Please sign in to comment.