mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-15 14:38:03 +02:00
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:
@@ -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) {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user