chore: tech debt clearing - getServerSession has a dead arg: res (#19053)
* remove res from arg list in getServerSession * remove res from all usages of getServerSession
This commit is contained in:
1 parent
15d6839985
commit
f0dc3bba17
29 files changed
+42
-45
No files matched your search
@@ -4,7 +4,7 @@ import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
|
||||
import { getFeatureFlag } from "@calcom/features/flags/server/utils";
|
||||
import { MembershipRole } from "@calcom/prisma/client";
|
||||
|
||||
export const getServerSideProps = async ({ req, res }: GetServerSidePropsContext) => {
|
||||
export const getServerSideProps = async ({ req }: GetServerSidePropsContext) => {
|
||||
const prisma = await import("@calcom/prisma").then((mod) => mod.default);
|
||||
const organizationsEnabled = await getFeatureFlag(prisma, "organizations");
|
||||
// Check if organizations are enabled
|
||||
@@ -15,7 +15,7 @@ export const getServerSideProps = async ({ req, res }: GetServerSidePropsContext
|
||||
}
|
||||
|
||||
// Check if logged in user has an organization assigned
|
||||
const session = await getServerSession({ req, res });
|
||||
const session = await getServerSession({ req });
|
||||
|
||||
if (!session?.user.profile?.organizationId) {
|
||||
return {
|
||||
|
||||
@@ -7,9 +7,8 @@ export type PageProps = inferSSRProps<typeof getServerSidePropsForMembers>;
|
||||
|
||||
export const getServerSidePropsForMembers = async function getServerSidePropsForMembers({
|
||||
req,
|
||||
res,
|
||||
}: GetServerSidePropsContext) {
|
||||
const session = await getServerSession({ req, res });
|
||||
const session = await getServerSession({ req });
|
||||
|
||||
if (!session || !session.user) {
|
||||
return {
|
||||
|
||||
@@ -72,7 +72,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
if (!metadata.success) throw new HttpError({ statusCode: 400, message: "Invalid team metadata" });
|
||||
}
|
||||
|
||||
const session = await getServerSession({ req, res });
|
||||
const session = await getServerSession({ req });
|
||||
|
||||
if (!session) return { message: "Team upgraded successfully" };
|
||||
|
||||
|
||||
Reference in new issue
Block a user