|
@ -52,7 +52,7 @@ export class TagService { |
|
|
include: { |
|
|
include: { |
|
|
_count: { |
|
|
_count: { |
|
|
select: { |
|
|
select: { |
|
|
orders: { |
|
|
activities: { |
|
|
where: { |
|
|
where: { |
|
|
userId |
|
|
userId |
|
|
} |
|
|
} |
|
@ -79,7 +79,7 @@ export class TagService { |
|
|
id, |
|
|
id, |
|
|
name, |
|
|
name, |
|
|
userId, |
|
|
userId, |
|
|
isUsed: _count.orders > 0 |
|
|
isUsed: _count.activities > 0 |
|
|
})); |
|
|
})); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -87,7 +87,7 @@ export class TagService { |
|
|
const tagsWithOrderCount = await this.prismaService.tag.findMany({ |
|
|
const tagsWithOrderCount = await this.prismaService.tag.findMany({ |
|
|
include: { |
|
|
include: { |
|
|
_count: { |
|
|
_count: { |
|
|
select: { orders: true } |
|
|
select: { activities: true } |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
@ -97,7 +97,7 @@ export class TagService { |
|
|
id, |
|
|
id, |
|
|
name, |
|
|
name, |
|
|
userId, |
|
|
userId, |
|
|
activityCount: _count.orders |
|
|
activityCount: _count.activities |
|
|
}; |
|
|
}; |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|