|
|
|
@ -1,4 +1,5 @@ |
|
|
|
import { Component } from '@angular/core'; |
|
|
|
import { Component, Inject } from '@angular/core'; |
|
|
|
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
|
|
|
import { ApiService } from '../../services/api.service'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
@ -8,8 +9,14 @@ import { ApiService } from '../../services/api.service'; |
|
|
|
}) |
|
|
|
export class UploadReplayDialogComponent { |
|
|
|
fileName = ''; |
|
|
|
seasonId: string = ''; |
|
|
|
|
|
|
|
constructor(private apiService: ApiService) {} |
|
|
|
constructor(private apiService: ApiService, |
|
|
|
@Inject(MAT_DIALOG_DATA) seasonId: string |
|
|
|
) |
|
|
|
{ |
|
|
|
this.seasonId = seasonId; |
|
|
|
} |
|
|
|
|
|
|
|
onFileSelected(event: any) |
|
|
|
{ |
|
|
|
@ -19,6 +26,7 @@ export class UploadReplayDialogComponent { |
|
|
|
this.fileName = file.name; |
|
|
|
let formData = new FormData(); |
|
|
|
formData.append("file", file); |
|
|
|
formData.append("seasonID", this.seasonId); |
|
|
|
const upload$ = this.apiService.postReplayUpload(formData); |
|
|
|
upload$.subscribe(); |
|
|
|
} |
|
|
|
|