busao
    Preparing search index...

    Function cancelTrip

    • Cancels a trip via token.

      Parameters

      • database: BunSQLiteDatabase

        The project's database.

      • token: string

        The token of the trip.

      Returns Promise<
          {
              date: string;
              id: string;
              name: string;
              status: "cancelled"
              | "confirmed"
              | "waitlist";
              trip: "oneWay" | "return";
              tripToken: string;
          },
      >

      The trip as updated in the database.

      As a side-effect, if the trip was confirmed, it increases the priority of the oldest entry in the waitlist.

      TripTokenNotFoundError Thrown in case the token wasn't found in the database.

      DatabaseUpdateError Thrown in case something went wrong while cancelling the trip.