mirror of
https://github.com/fspc/BikeShed-1.git
synced 2025-04-04 05:33:22 -04:00
-Checkin/out api methods can be used while signed in -Added checkout button in Netzke App, which also signs out in addition to checking out.
22 lines
477 B
JavaScript
22 lines
477 B
JavaScript
{
|
|
//this will give a 401 error, but made 401 exceptions forward to 'users/sign_in'
|
|
onSignOut: function(){
|
|
Ext.Ajax.request({
|
|
url: '/users/sign_out',
|
|
method: 'DELETE'
|
|
});
|
|
},
|
|
onCheckOut: function(){
|
|
Ext.Ajax.request({
|
|
url: '/api/v1/checkout',
|
|
method: 'POST',
|
|
success: function(response, opts) {
|
|
Ext.Ajax.request({
|
|
url: '/users/sign_out',
|
|
method: 'DELETE'
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|