Skip to content

Commit

Permalink
Reorder javascript functions for better understanding
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Sep 18, 2024
1 parent a3668e3 commit c1186d2
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions client/app/src/shared/services/utils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,19 +425,6 @@ export class UtilsService {
window.print();
}

saveAs(authenticationService: AuthenticationService, filename: any, url: string): void {

const headers = new HttpHeaders({
"X-Session": authenticationService.session.id
});

this.http.get(url, {responseType: "blob", headers: headers}).subscribe(
response => {
this.saveBlobAs(filename, response);
}
);
}

saveBlobAs(filename:string,response:Blob){
const blob = new Blob([response], {type: "text/plain;charset=utf-8"});
const blobUrl = URL.createObjectURL(blob);
Expand All @@ -452,6 +439,18 @@ export class UtilsService {
}, 1000);
}

saveAs(authenticationService: AuthenticationService, filename: any, url: string): void {
const headers = new HttpHeaders({
"X-Session": authenticationService.session.id
});

this.http.get(url, {responseType: "blob", headers: headers}).subscribe(
response => {
this.saveBlobAs(filename, response);
}
);
}

getPostponeDate(ttl: number): Date {
const date = new Date();
date.setDate(date.getDate() + ttl + 1);
Expand Down

0 comments on commit c1186d2

Please sign in to comment.