phpvms/resources/js/frontend/bids.js
Nabeel S 09f3e3cfdf
Set the baseURL for ajax requests (#373)
* Set the baseURL for ajax requests

* Use async/await on AJAX calls

* Add mix_public() cache generated asset cache busting

* Move storage container into separate class

* Fix some styling
2019-08-27 15:08:42 -04:00

42 lines
710 B
JavaScript

'use strict';
/**
* Add a bid to a flight
*
* @param {String} flight_id
*
* @returns {Promise<*>}
*/
export async function addBid(flight_id) {
const params = {
method: 'POST',
url: '/api/user/bids',
data: {
'_method': 'POST',
'flight_id': flight_id
}
};
return axios(params);
}
/**
* Remove a bid from a given flight
*
* @param {String} flight_id
*
* @returns {Promise<*>}
*/
export async function removeBid(flight_id) {
const params = {
method: 'POST',
url: '/api/user/bids',
data: {
'_method': 'DELETE',
'flight_id': flight_id
}
};
return axios(params);
}