perf: fetch only by id (#19154)
* perf: fetch only by id * remove getServerSession --------- Co-authored-by: hbjORbj <[email protected]>
This commit is contained in:
1 parent
0fb0974769
commit
76c09ca7bf
2 files changed
+5
-35
No files matched your search
@@ -441,37 +441,10 @@ export class EventTypeRepository {
|
||||
});
|
||||
}
|
||||
|
||||
static async findTitleById({ id, userId }: { id: number; userId: number }) {
|
||||
return await prisma.eventType.findFirst({
|
||||
static async findTitleById({ id }: { id: number }) {
|
||||
return await prisma.eventType.findUnique({
|
||||
where: {
|
||||
AND: [
|
||||
{
|
||||
OR: [
|
||||
{
|
||||
users: {
|
||||
some: {
|
||||
id: userId,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
team: {
|
||||
members: {
|
||||
some: {
|
||||
userId: userId,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
userId: userId,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id,
|
||||
},
|
||||
],
|
||||
id,
|
||||
},
|
||||
select: {
|
||||
title: true,
|
||||
|
||||
Reference in new issue
Block a user