diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index f2a0b41..bf18aff 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -27,5 +27,5 @@ jobs: - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.GH_PAGES }} publish_dir: ./dist/pdf-removal diff --git a/src/app/core/service/pdf_backend_service/pdfBackend.service.ts b/src/app/core/service/pdf_backend_service/pdfBackend.service.ts index b8d4a70..56f1242 100644 --- a/src/app/core/service/pdf_backend_service/pdfBackend.service.ts +++ b/src/app/core/service/pdf_backend_service/pdfBackend.service.ts @@ -5,15 +5,23 @@ import { HttpClient } from '@angular/common/http'; providedIn: 'root', }) export class PdfBackendService { + private apiUrl = 'http://localhost:5000'; + constructor(private http: HttpClient) {} + unlockPdf(password: string, pdfFile: File) { const formData = new FormData(); formData.append('password', password); formData.append('pdfFile', pdfFile); - const observable = this.http.post(`${this.apiUrl}/unlock-pdf`, formData, { - responseType: 'blob', - }); + const observable = this.http.post( + `${this.apiUrl}/remove_password`, + formData, + { + responseType: 'blob', + } + ); return observable; } + } diff --git a/src/app/pdf-password-remover/remove-password/remove-password.component.ts b/src/app/pdf-password-remover/remove-password/remove-password.component.ts index f9cb941..42d28ec 100644 --- a/src/app/pdf-password-remover/remove-password/remove-password.component.ts +++ b/src/app/pdf-password-remover/remove-password/remove-password.component.ts @@ -22,6 +22,7 @@ export class RemovePasswordComponent { toggleShowPassword() { this.isHidePassword = !this.isHidePassword; } + unlockPDF() { this.pdfFile = this.pdfService.getSelectedPdfFile(); this.pdfBackendService.unlockPdf(this.password, this.pdfFile).subscribe(