Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export const context = async ({ req }: { req: Request }): Promise<Context> => {
if (
Copy link
Member

@aimedivin aimedivin Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elijahladdie , also look into this

!token &&
!req.body.variables.organisationInput &&
!req.body.variables.loginInput
!req.body.variables.organizationInput &&
!req.body.variables.loginInput &&
!req.body.variables.orgToken &&
!req.body.variables.orgInput
) {
return { clientIpAdress }
} else {
Expand Down
8 changes: 5 additions & 3 deletions src/resolvers/team.resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ const resolvers = {
const prevTeamName = team.name
const teamCohort = team?.cohort
const cohortProgram = team?.cohort?.program as ProgramType
const cohortOrg = cohortProgram.organization as OrganizationType
const cohortOrg = cohortProgram?.organization as OrganizationType
const org = await checkLoggedInOrganization(orgToken)

if (!team) {
Expand All @@ -564,8 +564,10 @@ const resolvers = {

if (role !== RoleOfUser.SUPER_ADMIN) {
const org = await checkLoggedInOrganization(orgToken)

if (cohortOrg.id.toString() !== org.id.toString()) {
console.log('>>>>>>>>>>>>>')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elijahladdie remove these console.logs

console.log(cohortOrg)
console.log('>>>>>>>>>>>>>')
if (cohortOrg?.id.toString() !== org.id.toString()) {
throw new GraphQLError(
`Team with id "${team?.id}" doesn't exist in this organization`,
{
Expand Down
Loading