feat(frontend): update page routes
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -76,6 +76,11 @@
|
||||
let showEditRequestModal = $state(false);
|
||||
let selectedEditRequest = $state<EditRequest | null>(null);
|
||||
|
||||
function openBookingModal(bookingId: string) {
|
||||
selectedBooking = { id: bookingId };
|
||||
showBookingModal = true;
|
||||
}
|
||||
|
||||
let pageState = $state<'loading' | 'authorized' | 'unauthorized'>('loading');
|
||||
|
||||
$effect(() => {
|
||||
@@ -94,12 +99,12 @@
|
||||
const reasonLabels: Record<string, string> = {
|
||||
pending_booking: 'Booking Pending Approval',
|
||||
edit_request: 'Customer Requested Booking Change',
|
||||
edit_requested: 'Booking Edit Requested',
|
||||
edit_requested: 'Booking Edit/Reschedule Requested',
|
||||
new_booking: 'New Booking Received',
|
||||
cancelled_booking: 'Booking Cancelled',
|
||||
late_cancellation: 'Late Cancellation (< 24h)',
|
||||
no_deposit: 'Deposit Issue',
|
||||
deposit_paid: 'Deposit Payment Received',
|
||||
deposit_not_paid_by_deadline: 'Deposit Deadline Passed',
|
||||
affiliate_claim: 'Affiliate Referral Claimed',
|
||||
'1_month_no_pay': 'No Payments in 1 Month',
|
||||
'1_week_no_pay': 'No Payments in 1 Week'
|
||||
@@ -115,7 +120,7 @@
|
||||
case 'edit_requested':
|
||||
return 'edit_approve';
|
||||
case 'late_cancellation':
|
||||
case 'no_deposit':
|
||||
case 'deposit_not_paid_by_deadline':
|
||||
case '1_week_no_pay':
|
||||
case '1_month_no_pay':
|
||||
return 'see_user';
|
||||
@@ -198,13 +203,13 @@
|
||||
selectedEditRequest = data.edit_request;
|
||||
showEditRequestModal = true;
|
||||
} else if (response.status === 404) {
|
||||
toast.error('This edit request has already been processed');
|
||||
toast.error('This edit/reschedule request has already been processed');
|
||||
} else {
|
||||
toast.error('Could not load edit request details');
|
||||
toast.error('Could not load edit/reschedule request details');
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Error fetching edit request:', err);
|
||||
toast.error('Network error loading edit request');
|
||||
toast.error('Network error loading edit/reschedule request');
|
||||
}
|
||||
} else if (action === 'see_user' && notification.user_id) {
|
||||
selectedUserId = notification.user_id;
|
||||
@@ -504,7 +509,7 @@
|
||||
|
||||
<BookingModal bind:open={showBookingModal} bookingId={selectedBooking?.id ?? ''} />
|
||||
|
||||
<UserModal bind:open={showUserModal} userId={selectedUserId ?? ''} />
|
||||
<UserModal bind:open={showUserModal} userId={selectedUserId ?? ''} openBookingModal={openBookingModal} />
|
||||
|
||||
{#if showEditRequestModal && selectedEditRequest}
|
||||
<EditRequestModal
|
||||
|
||||
Reference in New Issue
Block a user