add WebSocket support for real-time delivery updates with JWT authentication and automatic reconnection
This commit is contained in:
@@ -3,7 +3,7 @@ import { backendDateToFrontend } from '../utils/date';
|
||||
import type { Delivery, DeliveryRequestSource, PickupLocation, DeliveryStatus } from '../types';
|
||||
|
||||
// Types matching backend responses
|
||||
interface BackendDelivery {
|
||||
export interface BackendDelivery {
|
||||
id: string;
|
||||
date: string; // YYYY-MM-DD from pgtype.Date
|
||||
pickup_location: PickupLocation;
|
||||
@@ -57,7 +57,7 @@ interface UpdateDeliveryResponse {
|
||||
}
|
||||
|
||||
// Map backend delivery to frontend delivery
|
||||
function mapBackendToFrontend(backend: BackendDelivery): Delivery {
|
||||
export function mapBackendToFrontend(backend: BackendDelivery): Delivery {
|
||||
return {
|
||||
id: backend.id,
|
||||
date: backendDateToFrontend(backend.date),
|
||||
|
||||
Reference in New Issue
Block a user