diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index bcc2c20..6bbd04a 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -3,8 +3,9 @@ "", "\\src", "\\src\\app", - "\\src\\app\\boards", + "\\src\\app\\send-post", "\\src\\app\\services" ], + "SelectedNode": "\\src\\app\\services\\api-chat.service.ts", "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 00ba346..6bc0bea 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/src/app/boards/post/post.component.html b/src/app/boards/post/post.component.html index 7181ce5..30589a8 100644 --- a/src/app/boards/post/post.component.html +++ b/src/app/boards/post/post.component.html @@ -1,5 +1,5 @@
{{filename}} : {{progress}}
diff --git a/src/app/send-post/send-post.component.ts b/src/app/send-post/send-post.component.ts index 9f9d36c..682466f 100644 --- a/src/app/send-post/send-post.component.ts +++ b/src/app/send-post/send-post.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, EventEmitter, OnInit, Output } from '@angular/core'; import { ApiChatService } from '../services/api-chat.service'; import { MinIoService } from '../services/min-io.service.' @@ -9,15 +9,22 @@ import { MinIoService } from '../services/min-io.service.' }) export class SendPostComponent implements OnInit { + progress: number; + message: string; + filename = ''; + constructor(public apiChatService: ApiChatService, public minIoService: MinIoService) { } + sendPost(text: string) { this.apiChatService.sendPostToApi(text).subscribe(); } sendPic(event: any) { - this.minIoService.SendPicture(event); + this.filename = event.target.files[0].name; + //console.log(event.target.files[0]); + this.apiChatService.sendpic(event.target.files[0]).subscribe(); } ngOnInit(): void { diff --git a/src/app/services/api-chat.service.ts b/src/app/services/api-chat.service.ts index f51b005..dcb8d37 100644 --- a/src/app/services/api-chat.service.ts +++ b/src/app/services/api-chat.service.ts @@ -11,20 +11,29 @@ export class ApiChatService { } getPosts(): Observable