[FIX] moved get_uuid call to rest methods where it belongs; changed charts API tool to use ISO dates

This commit is contained in:
mDuo13
2015-04-06 13:35:11 -07:00
parent 4a3657fbea
commit 5e4bfcb626
3 changed files with 42 additions and 39 deletions

View File

@@ -306,4 +306,22 @@ Request("Generate UUID", {
link: "#create-client-resource-id"
});
//helper to fill the default payment with a new UUID
function get_uuid(callback) {
$.get(URL_BASE + "/v1/uuid").done(callback);
}
$(document).ready(function(){
get_uuid(function(resp,status,xhr) {
requests["submit-payment"].body.client_resource_id = resp.uuid;
if (window.location.hash == "#submit-payment") {
//we might have already loaded the call by the time the AJAX
// completes, so refresh the default body.
// Debatably a bad idea, because if the AJAX takes so long that the
// user has already started editing the call, it'll reset it.
select_request("submit-payment");
}
});
});
//---------- End req. List ---------------------------//