fix: distinguish repository publication and settings dates

This commit is contained in:
Thomas Durieux committed 2026-09-13 08:42:54 +00:00
1 parent 22096a8346
commit 7cdf0f5e8d
12 files changed
+167 -21

No files matched your search

+4
View File
@@ -173,8 +173,10 @@ router.post(
const reactivating = repo.status === RepositoryStatus.EXPIRED;
const updates: Record<string, Date> = {
"options.expirationDate": newExpiration,
settingsSavedAt: new Date(),
};
repo.model.options.expirationDate = newExpiration;
repo.model.settingsSavedAt = updates.settingsSavedAt;
if (reactivating) {
repo.model.anonymizeDate = new Date();
updates.anonymizeDate = repo.model.anonymizeDate;
@@ -572,6 +574,7 @@ router.post(
{ _id: repo.model._id, "githubAccess.revision": previousAccessRevision || { $exists: false } },
{
$set: {
settingsSavedAt: new Date(),
options: repo.model.options,
source: repo.model.source,
githubAccess: repo.model.githubAccess,
@@ -647,6 +650,7 @@ router.post("/", async (req, res) => {
const repo = new AnonymizedRepositoryModel();
repo.repoId = repoUpdate.repoId;
repo.anonymizeDate = new Date();
repo.settingsSavedAt = repo.anonymizeDate;
repo.owner = user.id;
repo.githubAccess = selectedAccess.binding;