Skip to content

Commit

Permalink
fix(admin, api): 123 - expend expiration Date
Browse files Browse the repository at this point in the history
  • Loading branch information
GuiPich91 committed Jan 30, 2025
1 parent 443e3cb commit d96122b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions api/migrations/20250130154020-expendExpirationTokenDate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const { ReferentModel } = require("../src/models");

module.exports = {
async up() {
const inOneMonth = new Date();
inOneMonth.setMonth(inOneMonth.getMonth() + 1);

await ReferentModel.updateMany(
{
role: "referent_classe",
invitationToken: { $exists: true, $nin: ["", null] },
"metadata.invitationType": { $exists: true },
},
{ $set: { invitationExpires: inOneMonth } },
);
},
};

0 comments on commit d96122b

Please sign in to comment.