Skip to content

Commit ba93cf8

Browse files
committed
move rate limit event to top
1 parent 6ee13bf commit ba93cf8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/routes/conversation/[id]/+server.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ export async function POST({ request, fetch, locals, params, getClientAddress })
3838
throw error(404, "Conversation not found");
3939
}
4040

41+
await collections.messageEvents.insertOne({
42+
userId: userId,
43+
createdAt: new Date(),
44+
ip: getClientAddress(),
45+
});
46+
4147
if (
4248
!locals.user?._id &&
4349
requiresUser &&
@@ -184,12 +190,6 @@ export async function POST({ request, fetch, locals, params, getClientAddress })
184190
updatedAt: new Date(),
185191
});
186192

187-
await collections.messageEvents.insertOne({
188-
userId: userId,
189-
createdAt: new Date(),
190-
ip: getClientAddress(),
191-
});
192-
193193
await collections.conversations.updateOne(
194194
{
195195
_id: convId,

0 commit comments

Comments
 (0)