Skip to content

Commit f35ae26

Browse files
WHOOOPWHOOOP
WHOOOP
authored and
WHOOOP
committed
Updates idrk
1 parent fe8e70d commit f35ae26

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

pages/workspace/[id]/allys.tsx

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { pageWithLayout } from "@/layoutTypes";
33
import { loginState } from "@/state";
44
import axios from "axios";
55
import { useRouter } from "next/router";
6+
import { getConfig } from "@/utils/configEngine";
67
import { useState, Fragment, useMemo } from "react";
78
import randomText from "@/utils/randomText";
89
import { useRecoilState } from "recoil";
@@ -26,30 +27,27 @@ type Form = {
2627

2728
export const getServerSideProps = withPermissionCheckSsr(
2829
async ({ req, res, params }) => {
29-
30-
31-
32-
33-
const quotas = await prisma.quota.findMany({
30+
const users = await prisma.user.findMany({
3431
where: {
35-
workspaceGroupId: parseInt(params?.id as string)
36-
},
37-
include: {
38-
assignedRoles: true
32+
roles: {
33+
some: {
34+
workspaceGroupId: parseInt(params?.id as string),
35+
permissions: {
36+
has: 'represent_alliance'
37+
}
38+
}
39+
}
3940
}
4041
});
4142

42-
const roles = await prisma.role.findMany({
43-
where: {
44-
workspaceGroupId: Number(params?.id),
45-
isOwnerRole: false
46-
},
47-
});
43+
44+
45+
46+
4847

4948
return {
5049
props: {
51-
quotas,
52-
roles
50+
users
5351
}
5452
}
5553
}, 'manage_activity'

0 commit comments

Comments
 (0)