linked the admin confirm deposte
All checks were successful
Build frontend / build (push) Successful in 1m9s

This commit is contained in:
mouazkh
2026-04-16 21:15:21 +03:00
parent 5a7d0ef265
commit 04fa34107b
2 changed files with 264 additions and 185 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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',