fix: force-fetch repo details so newly enabled features show up

The Anonymize form used the cached RepositoryModel for hasPage,
defaultBranch, etc. — so enabling GitHub Pages (or changing the
default branch) on the source after first cache wouldn't reflect in
the UI, leaving the GitHub Pages checkbox grayed out.

Pass force=1 when loading the form's repo details so the backend
re-queries the GitHub API once. The cost is a single GET /repos/...
call per form load.

Fixes #364.
This commit is contained in:
tdurieux
2026-05-04 11:58:44 +02:00
parent ef78e8ff3c
commit 62a2c1cd5c
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -1365,8 +1365,11 @@ angular
const o = parseGithubUrl($scope.sourceUrl);
try {
resetValidity();
// force=1 so newly enabled features (e.g. GitHub Pages — see
// #364) are reflected without waiting for the cached metadata to
// expire. The endpoint hits the GitHub API once.
const res = await $http.get(`/api/repo/${o.owner}/${o.repo}/`, {
params: { repositoryID: $scope.repositoryID },
params: { repositoryID: $scope.repositoryID, force: "1" },
});
$scope.details = res.data;
if (!$scope.repoId) {
+1 -1
View File
File diff suppressed because one or more lines are too long