Skip to content

Commit 0b2bf33

Browse files
author
JLRR2019
committed
Leves retoques del formulario de noticias
1 parent 84f96ad commit 0b2bf33

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

frontend/src/app/app.routing.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { HomeComponent } from './components/home/home.component';
66
import { NewsComponent } from './components/news/news.component';
77
import { ShowNewsComponent } from './components/news/showNews.component';
88
import { UserProfile } from './components/user/userProfile.component';
9+
import { EditNewComponent } from './components/Admin/editNew.component';
910

1011
//aquí tenemos que completar todo lo que queremos que se vaya cargando en el router-outlet
1112
//ojo, el template no debe llamar al servicio, hay que hacerlo a través del componente
@@ -17,6 +18,7 @@ const appRoutes = [
1718
{ path: 'userProfile', component: UserProfile},
1819
{ path: 'videogamecatalog', component: VideogameCatalogComponent },
1920
{ path: 'videogame/:id', component: VideogameDetailComponent },
21+
{ path: 'new/edit/:id', component: EditNewComponent },
2022
{ path: '', redirectTo: 'home', pathMatch: 'full' }
2123

2224
]

frontend/src/app/components/Admin/editNewForm.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ export class EditNewFormComponent {
1919

2020
constructor(public router: Router, public newsService: NewsService, activatedRoute: ActivatedRoute){
2121

22-
const id = activatedRoute.snapshot.params['id'];
22+
/*const id = activatedRoute.snapshot.params['id'];
2323
this.newsService.getNew(id).subscribe(
2424
(news) => this.news = news as News,
2525
(error: any) => console.error(error)
2626
27-
);
27+
);*/
2828

2929
}
3030

@@ -44,7 +44,7 @@ export class EditNewFormComponent {
4444
}
4545

4646
private afterUploadImage(news: News){
47-
this.router.navigate(['/showNew/', news.id]);
47+
this.router.navigate(['/showNews/', news.id]);
4848
}
4949

5050

0 commit comments

Comments
 (0)