fix: event type filter by team (#10632)

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
pull/10546/head
Udit Takkar 2023-08-10 22:57:02 +05:30 committed by GitHub
parent 9c7d0ea604
commit 8bdd835a68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -301,12 +301,12 @@ export const getByViewerHandler = async ({ ctx, input }: GetByViewerOptions) =>
export function getPrismaWhereUserIdFromFilter( export function getPrismaWhereUserIdFromFilter(
userId: number, userId: number,
filters: NonNullable<TEventTypeInputSchema>["filters"] filters: NonNullable<TEventTypeInputSchema>["filters"] | undefined
) { ) {
if (!filters || !hasFilter(filters)) { if (!filters || !hasFilter(filters)) {
return userId; return userId;
} else if (filters.userIds?.[0] === userId) { } else if (filters.userIds?.[0] === userId) {
return userId; return userId;
} }
return null; return 0;
} }