mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-16 06:49:09 +02:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user