busao
    Preparing search index...

    Function handleTrips

    • Adds a trip regardless of direction.

      Parameters

      • i18n: i18n

        The internationalisation object.

      • request: Request

        The request to the associated endpoint.

      • database: BunSQLiteDatabase

        The project's database.

      • date: Date

        The date the trip was registered in.

      • openingHour: number

        The hour the website actually becomes available.

      Returns Promise<Response>

      • A "Too Early" page in case the user got to the page before the right time.
      • An error message in case any information in the form was missing.
      • An error message in case the submitted name exceeded the limit.
      • A response redirecting the user to the "Success" page in case nothing went wrong with the addition(s). Otherwise, returns a message letting the user know, and recreates the form for the user to try again.

      If the user reaches the page before the opening hour, a "Too Early" page is shown.