feature(dashboard): add ability to filter out events by profile id and ip (#101)
This commit is contained in:
committed by
GitHub
parent
27ee623584
commit
f4ad97d87d
@@ -1,3 +1,4 @@
|
||||
import { cacheable } from '@openpanel/redis';
|
||||
import type { Client, Prisma } from '../prisma-client';
|
||||
import { db } from '../prisma-client';
|
||||
|
||||
@@ -21,3 +22,16 @@ export async function getClientsByOrganizationId(organizationId: string) {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function getClientById(
|
||||
id: string,
|
||||
): Promise<IServiceClientWithProject | null> {
|
||||
return db.client.findUnique({
|
||||
where: { id },
|
||||
include: {
|
||||
project: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export const getClientByIdCached = cacheable(getClientById, 60 * 60 * 24);
|
||||
|
||||
Reference in New Issue
Block a user