We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1cd9df8 commit e458693Copy full SHA for e458693
apps/webapp/app/presenters/NewOrganizationPresenter.server.ts
@@ -10,11 +10,16 @@ export class NewOrganizationPresenter {
10
11
public async call({ userId }: { userId: User["id"] }) {
12
const organizations = await this.#prismaClient.organization.findMany({
13
+ select: {
14
+ projects: {
15
+ where: { deletedAt: null },
16
+ },
17
18
where: { members: { some: { userId } } },
19
});
20
21
return {
- hasOrganizations: organizations.length > 0,
22
+ hasOrganizations: organizations.filter((o) => o.projects.length > 0).length > 0,
23
};
24
}
25
0 commit comments