Skip to content

Commit c64bd18

Browse files
committed
fix: don't count deleted posts against the rate limit
1 parent 56cacd7 commit c64bd18

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/common/rateLimit.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export const ensurePostRateLimit = async (
6262
con.getRepository(Post).countBy({
6363
authorId: userId,
6464
createdAt: MoreThan(subDays(new Date(), 1)),
65+
deleted: false,
6566
}),
6667
remoteConfig.vars?.postRateLimit ?? 0,
6768
`Take a break. You already posted enough`,

0 commit comments

Comments
 (0)