fix: add event type validation (#24429)
* fix: add event type validation * fix: use isinteger * fix: use isinteger * fix: use isNumber * fix: use Error --------- Co-authored-by: Volnei Munhoz <volnei.munhoz@gmail.com>
This commit is contained in:
co-authored by
Volnei Munhoz
parent
4c5608147c
commit
71bd140fe4
@@ -33,6 +33,10 @@ export class BotDetectionService {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Number.isInteger(eventTypeId) || eventTypeId <= 0) {
|
||||
throw new Error(`Invalid eventTypeId: ${eventTypeId}. Must be a positive integer.`);
|
||||
}
|
||||
|
||||
// Fetch only the teamId from the event type
|
||||
const eventType = await this.eventTypeRepository.getTeamIdByEventTypeId({
|
||||
id: eventTypeId,
|
||||
|
||||
Reference in New Issue
Block a user