merge: fix: should use invite limit cycle to calculate invite/limit (!706)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/706

Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: dakkar <dakkar@thenautilus.net>
This commit is contained in:
dakkar 2024-10-22 14:07:17 +00:00
commit 60be692a0a

View file

@ -49,7 +49,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const policies = await this.roleService.getUserPolicies(me.id); const policies = await this.roleService.getUserPolicies(me.id);
const count = policies.inviteLimit ? await this.registrationTicketsRepository.countBy({ const count = policies.inviteLimit ? await this.registrationTicketsRepository.countBy({
id: MoreThan(this.idService.gen(Date.now() - (policies.inviteExpirationTime * 60 * 1000))), id: MoreThan(this.idService.gen(Date.now() - (policies.inviteLimitCycle * 60 * 1000))),
createdById: me.id, createdById: me.id,
}) : null; }) : null;