Update commit on branch refresh and validate commit exists on save

Refresh button now always updates the commit to the latest SHA instead
of preserving the stale one in edit mode. Both create and update routes
verify the commit still exists on GitHub before persisting.
This commit is contained in:
tdurieux
2026-05-06 21:14:53 +03:00
parent d1d6257512
commit d9104c2ec2
3 changed files with 18 additions and 4 deletions
+9
View File
@@ -431,6 +431,11 @@ router.post(
httpStatus: 404,
});
}
await repository.getCommitInfo(repoUpdate.source.commit, {
accessToken: user.accessToken,
});
const removeRepoFromConference = async (conferenceID: string) => {
const conf = await ConferenceModel.findOne({
conferenceID,
@@ -542,6 +547,10 @@ router.post("/", async (req: express.Request, res: express.Response) => {
});
}
await repository.getCommitInfo(repoUpdate.source.commit, {
accessToken: user.accessToken,
});
const repo = new AnonymizedRepositoryModel();
repo.repoId = repoUpdate.repoId;
repo.anonymizeDate = new Date();