Skip to content

Commit

Permalink
revert rule download change
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Jan 31, 2025
1 parent 5165dc0 commit 3636ae9
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/app/Shared/Services/Api.service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -885,17 +885,12 @@ export class ApiService {
}

downloadRule(name: string): void {
const filename = `${name}.json`;
this.doGet<Rule>(`rules/${name}`)
.pipe(
first(),
map((rule) => {
const file = new File([JSON.stringify(rule)], filename);
return URL.createObjectURL(file);
}),
concatMap((resourceUrl) => this.ctx.url(resourceUrl)),
)
.subscribe((resourceUrl) => {
.pipe(first())
.subscribe((rule) => {
const filename = `${rule.name}.json`;
const file = new File([JSON.stringify(rule)], filename);
const resourceUrl = URL.createObjectURL(file);
this.downloadFile(resourceUrl, filename);
setTimeout(() => URL.revokeObjectURL(resourceUrl), 1000);
});
Expand Down

0 comments on commit 3636ae9

Please sign in to comment.