Added the ability to download (export) archives from subscriptions

This commit is contained in:
Isaac Grynsztein
2020-03-08 22:24:59 -04:00
parent 6f3e94cf24
commit 846dd7e250
9 changed files with 43 additions and 5 deletions

View File

@@ -21,5 +21,7 @@
<mat-dialog-actions>
<button mat-button mat-dialog-close>Close</button>
<button mat-stroked-button (click)="downloadArchive()" color="accent">Export Archive</button>
<span class="spacer"></span>
<button mat-button (click)="unsubscribe()" color="warn">Unsubscribe</button>
</mat-dialog-actions>

View File

@@ -4,4 +4,6 @@
.info-item-value {
font-size: 13px;
}
}
.spacer {flex: 1 1 auto;}

View File

@@ -29,4 +29,11 @@ export class SubscriptionInfoDialogComponent implements OnInit {
});
}
downloadArchive() {
this.postsService.downloadArchive(this.sub).subscribe(res => {
const blob: Blob = res;
saveAs(blob, 'archive.txt');
});
}
}