2020-09-04 23:50:05 +08:00
|
|
|
/**
|
|
|
|
* Before you edit these, read the documentation on how these files are compiled:
|
2020-09-05 01:32:39 +08:00
|
|
|
* https://docs.phpvms.net/developers/building-assets
|
2020-09-04 23:50:05 +08:00
|
|
|
*
|
|
|
|
* Edits here don't take place until you compile these assets and then upload them.
|
|
|
|
*/
|
2019-08-30 20:08:00 +08:00
|
|
|
|
|
|
|
import request from '../request';
|
2019-08-28 03:08:42 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a bid to a flight
|
|
|
|
*
|
|
|
|
* @param {String} flight_id
|
|
|
|
*
|
|
|
|
* @returns {Promise<*>}
|
|
|
|
*/
|
|
|
|
export async function addBid(flight_id) {
|
2019-08-30 20:08:00 +08:00
|
|
|
const params = {
|
|
|
|
method: 'POST',
|
|
|
|
url: '/api/user/bids',
|
|
|
|
data: {
|
|
|
|
_method: 'POST',
|
|
|
|
flight_id,
|
|
|
|
},
|
|
|
|
};
|
2019-08-28 03:08:42 +08:00
|
|
|
|
2019-08-30 20:08:00 +08:00
|
|
|
return request(params);
|
2019-08-28 03:08:42 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove a bid from a given flight
|
|
|
|
*
|
|
|
|
* @param {String} flight_id
|
|
|
|
*
|
|
|
|
* @returns {Promise<*>}
|
|
|
|
*/
|
|
|
|
export async function removeBid(flight_id) {
|
2019-08-30 20:08:00 +08:00
|
|
|
const params = {
|
|
|
|
method: 'POST',
|
|
|
|
url: '/api/user/bids',
|
|
|
|
data: {
|
|
|
|
_method: 'DELETE',
|
|
|
|
flight_id,
|
|
|
|
},
|
|
|
|
};
|
2019-08-28 03:08:42 +08:00
|
|
|
|
2019-08-30 20:08:00 +08:00
|
|
|
return request(params);
|
2019-08-28 03:08:42 +08:00
|
|
|
}
|