mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-09-16 08:31:36 -04:00
Some js wasn't getting loaded at login. and other fixes
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
$(document).ready(function(){
|
||||
$("#checkin_menu").show();
|
||||
$("#checkin").click( function(e){
|
||||
var username = $("#user_email").val();
|
||||
var password = $("#user_password").val();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/api/v1/checkin',
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
processData: false,
|
||||
data: JSON.stringify({"username": username, "password": password }),
|
||||
complete: function() { },
|
||||
success: function(data) {
|
||||
alert("Checked IN!");
|
||||
$("#user_email").val('');
|
||||
$("#user_password").val('');
|
||||
},
|
||||
error: function(data,textStatus) {
|
||||
alert( "Error: " + JSON.parse(data.responseText)["error"]);
|
||||
}
|
||||
})
|
||||
});
|
||||
$("#checkout").click( function(e){
|
||||
var username = $("#user_email").val();
|
||||
var password = $("#user_password").val();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/api/v1/checkout',
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
processData: false,
|
||||
data: JSON.stringify({"username": username, "password": password }),
|
||||
complete: function() { },
|
||||
success: function(data) {
|
||||
alert("Checked OUT!");
|
||||
$("#user_email").val('');
|
||||
$("#user_password").val('');
|
||||
},
|
||||
error: function(data,textStatus) {
|
||||
alert( "Error: " + JSON.parse(data.responseText)["error"]);
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user