@@ -19,23 +19,81 @@ import { EditContestComponent } from './components/edit-contest/edit-contest.com
1919import { ProblemComponent } from './components/problem/problem.component' ;
2020import { AddProblemComponent } from './components/add-problem/add-problem.component' ;
2121
22+ import { AuthGuard } from './guards/auth.guard' ;
23+ import { NotAuthGuard } from './guards/not-auth.guard' ;
24+ import { SolultionSubmitComponent } from './components/solultion-submit/solultion-submit.component' ;
25+ import { SolutionComponent } from './components/solultion-submit/solution/solution.component' ;
2226
2327
2428const appRoutes : Routes = [
25- { path : '' , component : HomeComponent } ,
26- { path : 'about' , component : AboutComponent } ,
27- { path : 'register' , component : RegisterComponent } ,
28- { path : 'login' , component : LoginComponent } ,
29- { path : 'practice' , component : PracticeComponent } ,
30- { path : 'contest' , component : ContestComponent } ,
31- { path : 'discuss' , component : DiscussComponent } ,
32- { path : 'profile' , component : ProfileComponent } ,
33- { path : 'ide' , component : IdeComponent } ,
34- { path : 'contest/add-contest' , component : AddContestComponent } ,
35- { path : 'contest/:contest' , component : ProblemsComponent } ,
36- { path : 'contest/:contest/addproblem' , component : AddProblemComponent } ,
37- { path : 'contest/:contest/:problem' , component : ProblemComponent } ,
38- { path : 'contest/edit/:edit-contest' , component : EditContestComponent } ,
29+ {
30+ path : '' ,
31+ component : HomeComponent
32+ } ,
33+ {
34+ path : 'about' ,
35+ component : AboutComponent
36+ } ,
37+ {
38+ path : 'register' ,
39+ component : RegisterComponent
40+ } ,
41+ {
42+ path : 'login' ,
43+ component : LoginComponent
44+ } ,
45+ {
46+ path : 'practice' ,
47+ component : PracticeComponent
48+ } ,
49+ {
50+ path : 'contest' ,
51+ component : ContestComponent
52+ } ,
53+ {
54+ path : 'discuss' ,
55+ component : DiscussComponent
56+ } ,
57+ {
58+ path : 'profile' ,
59+ component : ProfileComponent ,
60+ canActivate : [ AuthGuard ]
61+ } ,
62+ {
63+ path : 'ide' ,
64+ component : IdeComponent
65+ } ,
66+ {
67+ path : ':contest/submit/:code' ,
68+ component : SolultionSubmitComponent
69+ } ,
70+ {
71+ path : 'submit/complete' ,
72+ component : SolutionComponent
73+ } ,
74+ {
75+ path : 'contest/add-contest' ,
76+ component : AddContestComponent ,
77+ canActivate : [ AuthGuard ]
78+ } ,
79+ {
80+ path : 'contest/:contest' ,
81+ component : ProblemsComponent
82+ } ,
83+ {
84+ path : 'contest/:contest/addproblem' ,
85+ component : AddProblemComponent ,
86+ canActivate : [ AuthGuard ]
87+ } ,
88+ {
89+ path : 'contest/:contest/:problem' ,
90+ component : ProblemComponent
91+ } ,
92+ {
93+ path : 'contest/edit/:edit-contest' ,
94+ component : EditContestComponent ,
95+ canActivate : [ AuthGuard ]
96+ }
3997] ;
4098
4199@NgModule ( {
0 commit comments