캔, 충전현황 페이지 API 연동

This commit is contained in:
Yu Sung
2023-08-06 14:27:31 +09:00
parent f66bfd8524
commit fb08221aa3
7 changed files with 81 additions and 151 deletions

21
src/api/can.js Normal file
View File

@@ -0,0 +1,21 @@
import Vue from 'vue';
async function deleteCan(id) {
return Vue.axios.delete('/admin/can/' + id);
}
async function getCans() {
return Vue.axios.get('/can');
}
async function insertCan(can, rewardCan, price) {
const request = {can: can, rewardCan: rewardCan, price: price}
return Vue.axios.post('/admin/can', request);
}
async function paymentCan(can, method, member_id) {
const request = {memberId: member_id, method: method, can: can}
return Vue.axios.post('/admin/can/charge', request)
}
export {getCans, insertCan, deleteCan, paymentCan}