linked the admin confirm deposte
All checks were successful
Build frontend / build (push) Successful in 1m9s
All checks were successful
Build frontend / build (push) Successful in 1m9s
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -380,6 +380,35 @@ export async function confirmDepositPayment(bookingId) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function adminConfirmDeposit(reservationId, adminId, comment = null) {
|
||||||
|
const token = AuthService.getToken();
|
||||||
|
|
||||||
|
const res = await fetch(`${API_BASE}/Reservations/AdminConfirmDeposit/admin-confirm-deposit`, {
|
||||||
|
method: 'PUT',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
...(token && { Authorization: `Bearer ${token}` }),
|
||||||
|
},
|
||||||
|
body: JSON.stringify({ reservationId, adminId, comment }),
|
||||||
|
});
|
||||||
|
|
||||||
|
const text = await res.text();
|
||||||
|
let data = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
data = text ? JSON.parse(text) : null;
|
||||||
|
if (data && typeof data === 'object' && 'data' in data) {
|
||||||
|
data = data.data;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
data = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
const message = typeof data === 'object' && data?.message ? data.message : null;
|
||||||
|
|
||||||
|
return { status: res.status, data, ok: res.ok, message };
|
||||||
|
}
|
||||||
|
|
||||||
export async function updateBookingStatus(bookingId, status) {
|
export async function updateBookingStatus(bookingId, status) {
|
||||||
return apiFetch('/Reservations/UpdateStatus', {
|
return apiFetch('/Reservations/UpdateStatus', {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
|
|||||||
Reference in New Issue
Block a user