import { Route } from '@angular/router';

import { ListComponent } from './components/list.component';
import { ReditComponent } from './components/redit.component';

import { NoticesResolver, NoticeResolver } from './resolvers/notice.resolver';

export const noticeRoutes: Route[] = [
  {
    path: '',
    pathMatch: 'full',
    redirectTo: 'list',
  },
  {
    path: 'list',
    component: ListComponent,
    resolve: {
      notices: NoticesResolver,
    },
  },
  {
    path: 'redit',
    component: ReditComponent,
  },
  {
    path: 'redit/:id',
    component: ReditComponent,
    resolve: {
      notice: NoticeResolver,
    },
  },
];
