133 lines
4.2 KiB
TypeScript
133 lines
4.2 KiB
TypeScript
import { Routes } from '@angular/router';
|
|
import { LogoutComponent } from './components/logout/logout.component';
|
|
import { NotFoundComponent } from './components/not-found/not-found.component';
|
|
|
|
import { KeycloakAuthGuard } from './guards/auth.guard';
|
|
import { ListingCategoryGuard } from './guards/listing-category.guard';
|
|
import { DetailsBusinessListingComponent } from './pages/details/details-business-listing/details-business-listing.component';
|
|
import { DetailsCommercialPropertyListingComponent } from './pages/details/details-commercial-property-listing/details-commercial-property-listing.component';
|
|
import { DetailsUserComponent } from './pages/details/details-user/details-user.component';
|
|
import { HomeComponent } from './pages/home/home.component';
|
|
import { BrokerListingsComponent } from './pages/listings/broker-listings/broker-listings.component';
|
|
import { BusinessListingsComponent } from './pages/listings/business-listings/business-listings.component';
|
|
import { CommercialPropertyListingsComponent } from './pages/listings/commercial-property-listings/commercial-property-listings.component';
|
|
import { PricingComponent } from './pages/pricing/pricing.component';
|
|
import { AccountComponent } from './pages/subscription/account/account.component';
|
|
import { EditBusinessListingComponent } from './pages/subscription/edit-business-listing/edit-business-listing.component';
|
|
import { EditCommercialPropertyListingComponent } from './pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component';
|
|
import { EmailUsComponent } from './pages/subscription/email-us/email-us.component';
|
|
import { FavoritesComponent } from './pages/subscription/favorites/favorites.component';
|
|
import { MyListingComponent } from './pages/subscription/my-listing/my-listing.component';
|
|
|
|
export const routes: Routes = [
|
|
{
|
|
path: 'businessListings',
|
|
component: BusinessListingsComponent,
|
|
runGuardsAndResolvers: 'always',
|
|
},
|
|
{
|
|
path: 'commercialPropertyListings',
|
|
component: CommercialPropertyListingsComponent,
|
|
runGuardsAndResolvers: 'always',
|
|
},
|
|
{
|
|
path: 'brokerListings',
|
|
component: BrokerListingsComponent,
|
|
runGuardsAndResolvers: 'always',
|
|
},
|
|
{
|
|
path: 'home',
|
|
component: HomeComponent,
|
|
},
|
|
// #########
|
|
// Listings Details
|
|
{
|
|
path: 'details-business-listing/:id',
|
|
component: DetailsBusinessListingComponent,
|
|
},
|
|
{
|
|
path: 'details-commercial-property-listing/:id',
|
|
component: DetailsCommercialPropertyListingComponent,
|
|
},
|
|
{
|
|
path: 'listing/:id',
|
|
canActivate: [ListingCategoryGuard],
|
|
component: NotFoundComponent, // Dummy-Komponente, wird nie angezeigt, da der Guard weiterleitet
|
|
},
|
|
// #########
|
|
// User Details
|
|
{
|
|
path: 'details-user/:id',
|
|
component: DetailsUserComponent,
|
|
},
|
|
// #########
|
|
// User edit
|
|
{
|
|
path: 'account',
|
|
component: AccountComponent,
|
|
canActivate: [KeycloakAuthGuard],
|
|
},
|
|
{
|
|
path: 'account/:id',
|
|
component: AccountComponent,
|
|
canActivate: [KeycloakAuthGuard],
|
|
},
|
|
// #########
|
|
// Create, Update Listings
|
|
{
|
|
path: 'editBusinessListing/:id',
|
|
component: EditBusinessListingComponent,
|
|
canActivate: [KeycloakAuthGuard],
|
|
},
|
|
{
|
|
path: 'createBusinessListing',
|
|
component: EditBusinessListingComponent,
|
|
canActivate: [KeycloakAuthGuard],
|
|
},
|
|
{
|
|
path: 'editCommercialPropertyListing/:id',
|
|
component: EditCommercialPropertyListingComponent,
|
|
canActivate: [KeycloakAuthGuard],
|
|
},
|
|
{
|
|
path: 'createCommercialPropertyListing',
|
|
component: EditCommercialPropertyListingComponent,
|
|
canActivate: [KeycloakAuthGuard],
|
|
},
|
|
// #########
|
|
// My Listings
|
|
{
|
|
path: 'myListings',
|
|
component: MyListingComponent,
|
|
canActivate: [KeycloakAuthGuard],
|
|
},
|
|
// #########
|
|
// My Favorites
|
|
{
|
|
path: 'myFavorites',
|
|
component: FavoritesComponent,
|
|
canActivate: [KeycloakAuthGuard],
|
|
},
|
|
// #########
|
|
// EMAil Us
|
|
{
|
|
path: 'emailUs',
|
|
component: EmailUsComponent,
|
|
canActivate: [KeycloakAuthGuard],
|
|
},
|
|
// #########
|
|
// Logout
|
|
{
|
|
path: 'logout',
|
|
component: LogoutComponent,
|
|
canActivate: [KeycloakAuthGuard],
|
|
},
|
|
// #########
|
|
// Pricing
|
|
{
|
|
path: 'pricing',
|
|
component: PricingComponent,
|
|
},
|
|
{ path: '**', redirectTo: 'home' },
|
|
];
|