Skip to content

Commit 8b66895

Browse files
committed
refactor: update route names
1 parent e736816 commit 8b66895

File tree

7 files changed

+13
-16
lines changed

7 files changed

+13
-16
lines changed

src/app/app-routing.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const routes: Routes = [
1313
loadChildren: () => import("./pages/auth/auth.module").then(m => m.AuthModule)
1414
},
1515
{
16-
path: "post",
16+
path: "posts",
1717
loadChildren: () => import("./pages/post/post.module").then(m => m.PostModule)
1818
},
1919
{
@@ -22,7 +22,7 @@ const routes: Routes = [
2222
},
2323
{
2424
path: "",
25-
redirectTo: "post",
25+
redirectTo: "posts",
2626
pathMatch: "full",
2727
}
2828
]

src/app/layouts/content-layout/header/header.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
<a routerLink="./user/profile" class="block duration-150 hover:bg-indigo-700 hover:rounded-t-lg hover:text-white px-4 py-3 transition-colors">
3030
Mi perfil
3131
</a>
32-
<a routerLink="./user/news" class="block duration-150 hover:bg-indigo-700 hover:text-white px-4 py-3 transition-colors">
33-
Mis noticias
32+
<a routerLink="./user/posts" class="block duration-150 hover:bg-indigo-700 hover:text-white px-4 py-3 transition-colors">
33+
Mis publicaciones
3434
</a>
35-
<a (click)="logout()" routerLink="./news" class="block duration-150 hover:bg-indigo-700 hover:rounded-b-lg hover:text-white px-4 py-3 transition-colors">
35+
<a (click)="logout()" routerLink="./posts" class="block duration-150 hover:bg-indigo-700 hover:rounded-b-lg hover:text-white px-4 py-3 transition-colors">
3636
Cerrar sesión
3737
</a>
3838
</div>

src/app/pages/auth/login-page/login-page.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h2 class="font-bold pb-2 text-3xl text-center text-indigo-700">
3939
</div>
4040
<div>
4141
<button
42-
class="btn-success w-full"
42+
class="btn-success disabled:bg-indigo-400 disabled:hover:bg-indigo-400 w-full"
4343
[disabled]="loginForm.invalid"
4444
type="submit"
4545
>

src/app/pages/auth/login-page/login-page.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class LoginPageComponent {
2828
.subscribe({
2929
next: () => {
3030
this.loading = false;
31-
this.router.navigateByUrl("/user/news");
31+
this.router.navigateByUrl("/user/posts");
3232
},
3333
error: () => {
3434
this.loading = false;

src/app/pages/user/list-post-page/list-post-page.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<h2>Mis Publicaciones</h2>
33
</div>
44
<div class="bg-white border-b-2 border-indigo-100 border-solid font-medium px-16 py-3 text-slate-700 text-xss">
5-
Inicio / <a routerLink="/user/post">Publicaciones</a>
5+
Inicio / <a routerLink="/user/posts">Publicaciones</a>
66
</div>
77
<section class="gap-y-10 grid">
88
<div class="mb-8 text-right">
9-
<a routerLink="/user/post/create">
9+
<a routerLink="/user/posts/create">
1010
<button class="btn-success">
1111
Nuevo
1212
</button>

src/app/pages/user/list-post-page/list-post-page.component.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@ import { Post } from "../../../core/interfaces/post.interface";
1111
styleUrl: "./list-post-page.component.scss",
1212
})
1313
export class ListPostPageComponent implements OnInit {
14+
private postService = inject(PostService);
1415
private toastrService = inject(ToastrService);
1516

1617
public idPost: string = "";
1718
public isOpen: boolean = false;
1819
public listPosts: Post[] = [];
1920

20-
constructor(
21-
private postService: PostService
22-
) {}
23-
2421
ngOnInit(): void {
2522
this.loadPosts();
2623
}

src/app/pages/user/user-routing.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ const routes: Routes = [
1414
component: ProfilePageComponent
1515
},
1616
{
17-
path: "post",
17+
path: "posts",
1818
canActivate: [ isAuthenticatedGuard ],
1919
component: ListPostPageComponent
2020
},
2121
{
22-
path: "post/create",
22+
path: "posts/create",
2323
canActivate: [ isAuthenticatedGuard ],
2424
component: FormPostPageComponent
2525
},
2626
{
27-
path: "post/:id",
27+
path: "posts/:id",
2828
canActivate: [ isAuthenticatedGuard ],
2929
component: FormPostPageComponent
3030
},

0 commit comments

Comments
 (0)