MCPcopy Create free account
hub / github.com/codealong-dev/ride-sharing / handleDeclineTrip

Function handleDeclineTrip

web/src/components/DriverMap.tsx:91–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89 }
90
91 const handleDeclineTrip = () => {
92 if (!requestedTrip || !requestedTrip.id || !driver) {
93 alert("No trip ID found or driver is not set")
94 return
95 }
96
97 sendMessage({
98 type: TripEvents.DriverTripDecline,
99 data: {
100 tripID: requestedTrip.id,
101 riderID: requestedTrip.userID,
102 driver: driver,
103 }
104 })
105
106 setTripStatus(TripEvents.DriverTripDecline)
107 resetTripStatus()
108 }
109
110 console.log({ requestedTrip })
111

Callers

nothing calls this directly

Calls 2

sendMessageFunction · 0.85
resetTripStatusFunction · 0.50

Tested by

no test coverage detected