Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
use correct links on public assertion page for json, baked images, an…
Browse files Browse the repository at this point in the history
…d verify links for assertions that were imported

fixes BGR-1473 BGR-1474
  • Loading branch information
coffindragger committed Feb 16, 2018
1 parent b4e91d7 commit b65f282
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/public/badge-assertion.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export class PublicBadgeAssertionComponent {
readonly badgeFailedImageUrl = require('../../breakdown/static/images/badge-failed.svg');

assertionIdParam: LoadedRouteParam<PublicApiBadgeAssertionWithBadgeClass>;
assertionId: string;

routerLinkForUrl = routerLinkForUrl;

Expand All @@ -224,6 +225,7 @@ export class PublicBadgeAssertionComponent {
injector.get(ActivatedRoute),
"assertionId",
paramValue => {
this.assertionId = paramValue;
const service: PublicApiService = injector.get(PublicApiService);
return service.getBadgeAssertion(paramValue).then(assertion => {
if (assertion.revoked) {
Expand Down Expand Up @@ -260,7 +262,7 @@ export class PublicBadgeAssertionComponent {
}

private get rawJsonUrl() {
return stripQueryParamsFromUrl(this.assertion.id) + ".json";
return `${this.configService.apiConfig.baseUrl}/public/assertions/${this.assertionId}.json`;
}

get v1JsonUrl() {
Expand All @@ -272,7 +274,7 @@ export class PublicBadgeAssertionComponent {
}

get rawBakedUrl() {
return stripQueryParamsFromUrl(this.assertion.id) + "/baked";
return `${this.configService.apiConfig.baseUrl}/public/assertions/${this.assertionId}/baked`;
}

get v1BakedUrl() {
Expand All @@ -284,6 +286,6 @@ export class PublicBadgeAssertionComponent {
}

get verifyUrl() {
return `${this.configService.assertionVerifyUrl}?url=${this.v1JsonUrl}`;
return `${this.configService.assertionVerifyUrl}?url=${this.assertion.id}`;
}
}

0 comments on commit b65f282

Please sign in to comment.