Fixed share page. Updated device detect. Updated teams fetch.
This commit is contained in:
@@ -42,7 +42,7 @@ export async function getTeams(
|
||||
);
|
||||
}
|
||||
|
||||
export async function getUserTeams(userId: string, filters: QueryFilters) {
|
||||
export async function getUserTeams(userId: string, filters: QueryFilters = {}) {
|
||||
return getTeams(
|
||||
{
|
||||
where: {
|
||||
@@ -80,6 +80,22 @@ export async function getUserTeams(userId: string, filters: QueryFilters) {
|
||||
);
|
||||
}
|
||||
|
||||
export async function getAllUserTeams(userId: string) {
|
||||
return prisma.client.team.findMany({
|
||||
where: {
|
||||
deletedAt: null,
|
||||
members: {
|
||||
some: { userId },
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
logoUrl: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function createTeam(data: Prisma.TeamCreateInput, userId: string): Promise<any> {
|
||||
const { id } = data;
|
||||
const { client, transaction } = prisma;
|
||||
|
||||
Reference in New Issue
Block a user