Skip to content

Commit

Permalink
fixed minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SaiKrishnaAnnam committed Oct 6, 2023
1 parent 2463922 commit 0ecfc18
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 11 additions & 3 deletions src/app/core/service/pdf_backend_service/pdfBackend.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 0ecfc18

Please sign in to comment.