From 93c5826bffc5babd09f4fa4c57b9bc4f5fd47800 Mon Sep 17 00:00:00 2001 From: RakVhalate Date: Sat, 12 Nov 2022 03:10:08 +1000 Subject: [PATCH] Support of board name parameter. --- src/app/boards/boards.component.html | 7 ++++--- src/app/boards/boards.component.ts | 6 +++--- src/app/services/api-chat.service.ts | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/app/boards/boards.component.html b/src/app/boards/boards.component.html index 607bd5e..e9c81d5 100644 --- a/src/app/boards/boards.component.html +++ b/src/app/boards/boards.component.html @@ -1,11 +1,12 @@
свiня , - +

/postgres/

+ - +
@@ -13,4 +14,4 @@
- \ No newline at end of file + diff --git a/src/app/boards/boards.component.ts b/src/app/boards/boards.component.ts index 1a0fef8..a0da53e 100644 --- a/src/app/boards/boards.component.ts +++ b/src/app/boards/boards.component.ts @@ -17,14 +17,14 @@ export class BoardsComponent implements OnInit { } - refreshPosts() { - this.apiChatService.getPosts().subscribe(response => { + refreshPosts(boardName: string) { + this.apiChatService.getPosts(boardName).subscribe(response => { this.postsToShow = response }) } ngOnInit(): void { - this.apiChatService.getPosts().subscribe(response => { + this.apiChatService.getPosts('postgres').subscribe(response => { this.postsToShow = response }) } diff --git a/src/app/services/api-chat.service.ts b/src/app/services/api-chat.service.ts index 33b3c6b..98fef19 100644 --- a/src/app/services/api-chat.service.ts +++ b/src/app/services/api-chat.service.ts @@ -10,10 +10,10 @@ export class ApiChatService { constructor(private http: HttpClient) { } - getPosts(): Observable { + getPosts(boardName:string): Observable { //console.log("Получаю посты и картинки"); - return this.http.get('http://api.vdk2ch.ru:5000/List/'); - //return this.http.get('http://localhost:7141/List/'); + //return this.http.get('http://api.vdk2ch.ru:5000/List/?board=' + boardName); + return this.http.get('http://localhost:7141/List/?board=' + boardName); } sendPostToApi(text: string, imgUrl: string) {