feat: add refund call

This commit is contained in:
Rogee
2025-05-06 20:30:00 +08:00
parent 41cdc821da
commit 533c9b70af
2 changed files with 16 additions and 4 deletions

View File

@@ -57,11 +57,23 @@ const getFinalPrice = (price, discount) => {
return price - getDiscountAmount(price, discount);
};
const refundOrder = async (id) => {
try {
await orderService.refund(id)
fetchOrders();
} catch (error) {
console.error('Failed to refund orders:', error);
toast.add({ severity: 'error', summary: '错误', detail: ' 退款失败', life: 3000 });
} finally {
loading.value = false;
}
}
const fetchOrders = async () => {
loading.value = true;
try {
const currentPage = (first.value / rows.value) + 1;
const response = await orderService.getOrders({
const response = await orderService.get({
page: currentPage,
limit: rows.value,
keyword: globalFilterValue.value