Skip to content

Commit ac3e4cd

Browse files
author
JLRR2019
committed
Arreglado problema de casteo en el servicio, ahora pasado al componente
1 parent 3652517 commit ac3e4cd

File tree

12 files changed

+53
-61
lines changed

12 files changed

+53
-61
lines changed

backend/gamelink/Docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ services:
1919
restart: always
2020
environment:
2121
- POSTGRES_USER=postgres
22-
- POSTGRES_PASSWORD=password
22+
- POSTGRES_PASSWORD=Juanluis-123
2323
- POSTGRES_DB=gamelink
2424
volumes:
2525
- ./postgres:/var/lib/postgres

backend/gamelink/target/classes/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spring.mustache.suffix=.html
1010

1111
spring.datasource.url=jdbc:postgresql://localhost:5432/gamelink
1212
spring.datasource.username=postgres
13-
spring.datasource.password=password
13+
spring.datasource.password=Juanluis-123
1414
spring.jpa.hibernate.ddl-auto=create-drop
1515

1616
logging.level.org.springframework.security=DEBUG
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<header></header>
2-
<!--navBar></navBar-->
2+
<navBar></navBar>
33

44
<home></home>
55

6-
<!--router-outlet></router-outlet-->
6+
7+
<router-outlet></router-outlet>
78
<footer></footer>

frontend/src/app/app.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ import { FooterComponent } from './components/footer/footer.component';
1313
import { NewsTemplateComponent } from './components/news/newsTemplate.component';
1414
import { ShowNewsComponent } from './components/news/showNews.component';
1515
import { HomeComponent } from './components/home/home.component';
16+
import { UserProfile } from './components/user/userProfile.component';
1617

1718

1819

1920

2021
@NgModule({
21-
declarations: [AppComponent, LoginComponent, HeadComponent, NewsComponent, NavBarComponent, FooterComponent, NewsTemplateComponent, ShowNewsComponent, HomeComponent],
22+
declarations: [AppComponent, LoginComponent, HeadComponent, NewsComponent, NavBarComponent, FooterComponent, NewsTemplateComponent, ShowNewsComponent, HomeComponent, UserProfile],
2223
imports: [BrowserModule, FormsModule, HttpClientModule, routing, FormsModule],
2324
bootstrap: [AppComponent]
2425
})
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<footer class="bg-dark py-4 mt-auto">
2-
<div class="container px-5">
3-
<div class="row align-items-center justify-content-between flex-column flex-sm-row">
4-
<div class="col-auto"><div class="small m-0 text-white">Copyright &copy; GameLink 2022</div></div>
5-
<div class="col-auto">
6-
<a class="link-light small" [routerLink]="['/about']">Privacy</a>
7-
<span class="text-white mx-1">&middot;</span>
8-
<a class="link-light small" [routerLink]="['/about']">Terms</a>
9-
<span class="text-white mx-1">&middot;</span>
10-
<a class="link-light small" [routerLink]="['/about']">Contact</a>
11-
</div>
12-
</div>
1+
<div class="container px-5">
2+
<div class="row align-items-center justify-content-between flex-column flex-sm-row">
3+
<div class="col-auto">
4+
<div class="small m-0 text-white">Copyright &copy; GameLink 2022</div>
135
</div>
14-
</footer>
6+
<div class="col-auto">
7+
<a class="link-light small" [routerLink]="['/about']">Privacy</a>
8+
<span class="text-white mx-1">&middot;</span>
9+
<a class="link-light small" [routerLink]="['/about']">Terms</a>
10+
<span class="text-white mx-1">&middot;</span>
11+
<a class="link-light small" [routerLink]="['/about']">Contact</a>
12+
</div>
13+
</div>
14+
</div>
Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
<head>
2-
<meta charset="utf-8" />
3-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
4-
<meta name="description" content="" />
5-
<meta name="author" content="" />
6-
<title>GameLink</title>
7-
<!--Scripts-->
8-
<!--<script src="https://code.jquery.com/jquery-3.2.1.js"></script>-->
9-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
10-
<!-- Favicon-->
11-
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico" />
12-
<!--PDF2-->
13-
<script src="/js/html2pdf.bundle.min.js"></script>
14-
<!-- Bootstrap icons-->
15-
<link href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" rel="stylesheet" />
16-
<!-- Core theme CSS (includes Bootstrap)-->
17-
<link href="/css/styles.css" rel="stylesheet" />
18-
<!--Chart.js librarie-->
19-
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.7.1/chart.js"></script>
20-
</head>
1+
<meta charset="utf-8" />
2+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
3+
<meta name="description" content="" />
4+
<meta name="author" content="" />
5+
<title>GameLink</title>
6+
<!--Scripts-->
7+
<!--<script src="https://code.jquery.com/jquery-3.2.1.js"></script>-->
8+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
9+
<!-- Favicon-->
10+
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico" />
11+
<!--PDF2-->
12+
<script src="/js/html2pdf.bundle.min.js"></script>
13+
<!-- Bootstrap icons-->
14+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" rel="stylesheet" />
15+
<!-- Core theme CSS (includes Bootstrap)-->
16+
<link href="/css/styles.css" rel="stylesheet" />
17+
<!--Chart.js librarie-->
18+
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.7.1/chart.js"></script>

frontend/src/app/components/navBar/navBar.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</li>
1515
<li class="nav-item"><a class="nav-link" href="/news">Noticias</a></li>
1616
<li class="nav-item"><a class="nav-link" href="/about">About</a></li>
17-
17+
1818
<p *ngIf="!loginService.isLogged()"><!--/p-->
1919
<li class="nav-item dropdown">
2020
<a class="nav-link dropdown-toggle" id="navbarDropdownBlog" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Sesión</a>

frontend/src/app/components/news/news.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class NewsComponent{
2121

2222
const id = activatedRoute.snapshot.params['id'];
2323
this.newsService.getNew(id).subscribe(
24-
//(news: News) => this.news = news,
24+
(news) => this.news = news as News, //casting in ts, es mejor hacerlo en el servicio (as Observable<News>), pero al dar error, hacemos el cast en el component
2525
(error: any) => console.error(error)
2626

2727

@@ -30,7 +30,7 @@ export class NewsComponent{
3030
}
3131

3232
getNewsImage(){
33-
if(this.news){ //Wwe have to put this always. If exist any new...
33+
if(this.news){ //We have to put this always. If exist any new...
3434
return this.news?.image+ '/api/news/' +this.news.id
3535
} else {
3636
return undefined;

frontend/src/app/components/news/newsTemplate.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class NewsTemplateComponent{
1818

1919
const id = activatedRoute.snapshot.params['id'];
2020
this.newsService.getNew(id).subscribe(
21-
//(news: News) => this.news = news,
21+
(news) => this.news = news as News,
2222
(error: any) => console.error(error)
2323

2424
);

frontend/src/app/components/news/showNews.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class ShowNewsComponent{
1818

1919
const id = activatedRoute.snapshot.params['id'];
2020
this.newsService.getNew(id).subscribe(
21-
//(news: News) => this.news = news,
21+
(news) => this.news = news as News,
2222
(error: any) => console.error(error)
2323

2424
);

0 commit comments

Comments
 (0)