From cb3909850171ecbd2d5093cafe53ca271d27b3fb Mon Sep 17 00:00:00 2001 From: SandObserver <260779319+SandObserver@users.noreply.github.com> Date: Mon, 26 Oct 2026 19:32:52 -0400 Subject: [PATCH] List Forgejo pull requests by last update --- api/test/github-data.test.js | 1 + ui/widgets/github/data.js | 1 + 2 files changed, 2 insertions(+) diff --git a/api/test/github-data.test.js b/api/test/github-data.test.js index 13f696b4..17ddd54c 100644 --- a/api/test/github-data.test.js +++ b/api/test/github-data.test.js @@ -93,6 +93,7 @@ for (const service of ['gitea', 'forgejo']) { assert.equal(r.totalCount, 31); assert.deepEqual(r.items, [{ number: 4, title: 'Fix', repo: 'me/app', url: 'https://git.lan/me/app/pulls/4' }]); assert.equal(r.allUrl, 'https://git.lan/pulls'); + assert.equal(url.searchParams.get('sort'), service === 'forgejo' ? 'recentupdate' : null); }); } diff --git a/ui/widgets/github/data.js b/ui/widgets/github/data.js index 7bb1abef..fd739b74 100644 --- a/ui/widgets/github/data.js +++ b/ui/widgets/github/data.js @@ -139,6 +139,7 @@ async function giteaPullRequests(ctx, base, token, config, name) { if (!filterArr.length) filterArr.push('created'); const q = new URLSearchParams({ type: 'pulls', state: 'open', limit: '20' }); for (const f of filterArr) q.set(GITEA_FILTER[f], 'true'); + if (config.githubService === 'forgejo') q.set('sort', 'recentupdate'); const r = await ctx.fetchJSON(`${base}/api/v1/repos/issues/search?${q}`, { headers: { Authorization: `token ${token}`, Accept: 'application/json' }, withHeaders: true,