Skip to content

Commit

Permalink
fix double-prefixed template download path
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Jan 31, 2025
1 parent 30f31fc commit 3e95598
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/Shared/Services/Api.service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ export class ApiService {
downloadRecording(recording: Recording): void {
this.ctx.url(recording.downloadUrl).subscribe((resourceUrl) => {
this.downloadFile(resourceUrl, recording.name + (recording.name.endsWith('.jfr') ? '' : '.jfr'));

const metadataUrl = createBlobURL(JSON.stringify(recording.metadata), 'application/json');
this.downloadFile(metadataUrl, recording.name.replace(/\.jfr$/, '') + '.metadata.json', false);
setTimeout(() => URL.revokeObjectURL(metadataUrl), 1000);
Expand All @@ -871,10 +872,9 @@ export class ApiService {
.pipe(
filter((t) => !!t),
first(),
concatMap((target) =>
this.ctx.url(
map(
(target) =>
`/api/v4/targets/${target!.id}/event_templates/${encodeURIComponent(template.type)}/${encodeURIComponent(template.name)}`,
),
),
concatMap((resourceUrl) => this.ctx.url(resourceUrl)),
)
Expand Down

0 comments on commit 3e95598

Please sign in to comment.