Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vgimonnet-wt committed Feb 19, 2024
1 parent dea64af commit 7685679
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions server/controllers/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ userController.post({ path: '' }, async (req, res) => {
const fromAdmin = req.user !== undefined && req.user.type === UserType.PLMO_ADMIN;
if (!fromAdmin) {
const invite = await getRepository(Invite).findOne({ where: { token: data.inviteCode } });
if (invite === undefined || invite.expired_at < new Date()) {
if (invite === undefined || invite.expiredAt < new Date()) {
if (invite !== undefined) {
await getRepository(Invite).delete({ token: data.inviteCode });
}
Expand Down Expand Up @@ -275,10 +275,10 @@ userController.delete({ path: '/:id' }, async (req, res) => {
userController.get({ path: '/invite' }, async (req, res) => {
const invite = new Invite();
invite.token = generateToken(20);
invite.created_at = new Date();
const nextDay = invite.created_at.getDate() + 1;
invite.expired_at = new Date();
invite.expired_at.setDate(nextDay);
invite.createdAt = new Date();
const nextDay = invite.createdAt.getDate() + 1;
invite.expiredAt = new Date();
invite.expiredAt.setDate(nextDay);
await getRepository(Invite).save(invite);
res.sendJSON({ inviteCode: invite.token });
});
Expand Down
4 changes: 2 additions & 2 deletions server/entities/invite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export class Invite {
public token: string;

@CreateDateColumn()
public created_at: Date;
public createdAt: Date;

@UpdateDateColumn()
public expired_at: Date;
public expiredAt: Date;
}

0 comments on commit 7685679

Please sign in to comment.