Skip to content

Commit

Permalink
frontend: simplify the pagination regex
Browse files Browse the repository at this point in the history
  • Loading branch information
xTVaser committed Oct 8, 2024
1 parent 88f93aa commit ab921b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/utils/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ async function parseGithubRelease(githubRelease: any): Promise<ReleaseInfo> {
}

export async function listOfficialReleases(): Promise<ReleaseInfo[]> {
const nextUrlPattern = /(?<=<)([\S]*)(?=>; rel="Next")/i;
const nextUrlPattern = /<([\S]+)>; rel="Next"/i;
let releases = [];
let urlToHit =
"https://api.github.com/repos/open-goal/jak-project/releases?per_page=100";
Expand All @@ -117,7 +117,7 @@ export async function listOfficialReleases(): Promise<ReleaseInfo[]> {
resp.headers.get("link").includes(`rel=\"next\"`)
) {
// we must paginate!
urlToHit = resp.headers.get("link").match(nextUrlPattern)[0];
urlToHit = resp.headers.get("link").match(nextUrlPattern)[1];
} else {
urlToHit = undefined;
}
Expand Down

0 comments on commit ab921b7

Please sign in to comment.