Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Raghav Kaul <[email protected]>
  • Loading branch information
raghavkaul committed Mar 25, 2024
1 parent 15e9f67 commit dd058ac
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions scorecards-site/static/viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -851,16 +851,10 @@
</div>
</div>
<div class="content"><small class="fw-semibold">API URL:</small>
{{#if data.repo.name}}
{{#if data.repo.commit}}
<a class="btn-link" href="https://api.scorecard.dev/{{data.repo.name}}?commit={{data.repo.commit}}" target="_blank" rel="noopener noreferrer">
https://api.scorecard.dev/{{data.repo.name}}
</a>
{{else}}
<a class="btn-link" href="https://api.scorecard.dev/{{data.repo.name}}" target="_blank" rel="noopener noreferrer">
https://api.scorecard.dev/{{data.repo.name}}
</a>
{{/if}}
{{#if apiURL}}
<a class="btn-link" href="{{apiURL}}" target="_blank" rel="noopener noreferrer">
https://api.scorecard.dev/{{data.repo.name}}
</a>
{{else}}
<span class="text-muted">-</span>
{{/if}}
Expand Down Expand Up @@ -1148,7 +1142,7 @@
document.getElementsByClassName('table-wrapper')[0].classList.add('embedded');
}

let platform, org, repo;
let platform, org, repo, apiURL;

if (params.uri) {
[platform, org, repo] = params.uri.split('/');
Expand Down Expand Up @@ -1317,7 +1311,8 @@
}

async function apiFetch(platform, org, repo, commit) {
const response = await fetch(`https://api.scorecard.dev/projects/${platform}/${org}/${repo}${commit ? `?commit=${commit}` : ''}`);
apiURL =`https://api.scorecard.dev/projects/${platform}/${org}/${repo}${commit ? `?commit=${commit}` : ''}`
const response = await fetch(apiURL);
if (response.ok) {
const data = await response.json();
return data;
Expand Down

0 comments on commit dd058ac

Please sign in to comment.