Controller for rider-related operations.
More...
Controller for rider-related operations.
◆ ConfirmDriver()
async Task< IActionResult > hagglehaul.Server.Controllers.RiderController.ConfirmDriver |
( |
[FromBody] AddTripDriver | addTripDriver | ) |
|
Confirm a driver for a trip.
- Parameters
-
addTripDriver | The form to confirm a driver with. |
- Returns
- OkResult if the driver is successfully confirmed, BadRequestObjectResult if the user is invalid, the trip does not exist, the trip has a driver, the trip has already started, or the bid does not exist, UnauthorizedResult if the user is not a rider
◆ DeleteRiderTrip()
async Task< IActionResult > hagglehaul.Server.Controllers.RiderController.DeleteRiderTrip |
( |
[FromQuery] string | tripId | ) |
|
Delete a trip.
- Parameters
-
tripId | The ID of the trip to delete. Rider must have create this trip. |
- Returns
- OkResult if the trip is successfully deleted, BadRequestObjectResult if the user is invalid, the trip does not exist, the trip has a driver, or the trip has already started, UnauthorizedResult if the user is not a rider
◆ Get()
async Task< IActionResult > hagglehaul.Server.Controllers.RiderController.Get |
( |
| ) |
|
Get the basic info of the current rider.
- Returns
- OkObjectResult with the rider's basic info, BadRequestObjectResult if the user is invalid, UnauthorizedResult if the user is not a rider
◆ GetDashboard()
async Task< IActionResult > hagglehaul.Server.Controllers.RiderController.GetDashboard |
( |
| ) |
|
Gets the necessary info for a rider dashboard. Shows confirmed trips, trips in bidding, and past trips.
- Returns
- OkObjectResult with the rider's dashboard, BadRequestObjectResult if the user is invalid, UnauthorizedResult if the user is not a rider
◆ ModifyAccountDetails()
async Task< IActionResult > hagglehaul.Server.Controllers.RiderController.ModifyAccountDetails |
( |
[FromBody] RiderUpdate | riderUpdate | ) |
|
Modify account details, including password.
- Parameters
-
riderUpdate | The update form. |
- Returns
- OkResult if the account details are successfully updated, BadRequestObjectResult if the user is invalid or there is an error with updating the password, UnauthorizedResult if the user is not a rider
◆ PostRiderTrip()
async Task< IActionResult > hagglehaul.Server.Controllers.RiderController.PostRiderTrip |
( |
[FromBody] CreateTrip | tripDetails | ) |
|
Create a new trip.
- Parameters
-
tripDetails | The form with the requested trip's details. |
- Returns
- OkResult if the trip is successfully created, BadRequestObjectResult if the user is invalid, the party size is invalid, or the start time is in the past, UnauthorizedResult if the user is not a rider
◆ RateDriver()
async Task< IActionResult > hagglehaul.Server.Controllers.RiderController.RateDriver |
( |
[FromBody] GiveRating | giveRating | ) |
|
Rate a driver.
- Parameters
-
giveRating | The form to rate a user. |
- Returns
- OkResult if the driver is successfully rated, BadRequestObjectResult if the user is invalid, the trip does not exist, the trip has no driver, the trip has not been taken yet, or the driver has already been rated, UnauthorizedResult if the user is not a rider
The documentation for this class was generated from the following file:
- /Users/jacob/Documents/Projects/130-project/hagglehaul/hagglehaul.Server/Controllers/RiderController.cs