front-end/src/layout/Routes.js
/**
 * Defines all the routes for the application.
 *
 * You will need to make changes to this file.
 *
 * @returns {JSX.Element}
 */
Defines all the routes for the application.
You will need to make changes to this file.


Defines all the routes for the application . You will need to make changes to this file .
function Routes() {
  const query = useQuery();
  const date = query.get("date");
  return (
    <Switch>
      <Route exact={true} path="/">
        <Redirect to={"/dashboard"} />
      </Route>
      <Route exact={true} path="/reservations/new">
        <NewReservation />
      </Route>
      <Route exact={true} path="/reservations">
        <Redirect to={"/dashboard"} />
      </Route>
      <Route path="/tables/new">
        <NewTable />
      </Route>
      <Route exact={true} path="/search">
        <Search />
      </Route>
      <Route exact={true} path="/reservations/:reservation_id/seat">
        <SeatForm />
      </Route>
      <Route exact={true} path="/reservations/:reservation_id/edit">
        <NewReservation />
      </Route>
      <Route path="/dashboard">
        <Dashboard date={date ? date : today()} />
      </Route>
      <Route>
        <NotFound />
      </Route>
    </Switch>
  );
}
function Routes ( ) { const query = useQuery ( ) ; const date = query . get ( "date" ) ; return ( < Switch > < Route exact = { true } path = "/" > < Redirect to = { "/dashboard" } / > < / Route > < Route exact = { true } path = "/reservations/new" > < NewReservation / > < / Route > < Route exact = { true } path = "/reservations" > < Redirect to = { "/dashboard" } / > < / Route > < Route path = "/tables/new" > < NewTable / > < / Route > < Route exact = { true } path = "/search" > < Search / > < / Route > < Route exact = { true } path = "/reservations/:reservation_id/seat" > < SeatForm / > < / Route > < Route exact = { true } path = "/reservations/:reservation_id/edit" > < NewReservation / > < / Route > < Route path = "/dashboard" > < Dashboard date = { date ? date : today ( ) } / > < / Route > < Route > < NotFound / > < / Route > < / Switch > ) ; }
Defines all the routes for the application.
Defines all the routes for the application .