update filename of download
This commit is contained in:
parent
10ce27683d
commit
74c1fac979
@ -134,7 +134,7 @@ export default abstract class BaseApiService {
|
|||||||
const anchor = document.createElement("a");
|
const anchor = document.createElement("a");
|
||||||
|
|
||||||
anchor.href = url;
|
anchor.href = url;
|
||||||
anchor.download = filename ?? uuid();
|
anchor.download = filename ?? `${uuid()}.pdf`;
|
||||||
anchor.click();
|
anchor.click();
|
||||||
|
|
||||||
URL.revokeObjectURL(url);
|
URL.revokeObjectURL(url);
|
||||||
|
@ -42,9 +42,8 @@ export default class OfficeFolderAnchors extends BaseNotary {
|
|||||||
public async download(uid: string): Promise<any> {
|
public async download(uid: string): Promise<any> {
|
||||||
const url = new URL(this.baseURl.concat(`/download/${uid}`));
|
const url = new URL(this.baseURl.concat(`/download/${uid}`));
|
||||||
try {
|
try {
|
||||||
return await this.getRequest<any>(url, undefined, ContentType.PDF, "attestation.pdf");
|
return await this.getRequest<any>(url, undefined, ContentType.PDF, `${uid}.pdf`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("ERROR: ", err);
|
|
||||||
this.onError(err);
|
this.onError(err);
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user