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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client'

import type { ExtendedSession } from 'types/auth'
import { useMutation, useQuery } from '@apollo/client/react'
import { addToast } from '@heroui/toast'
import { useRouter, useParams } from 'next/navigation'
Expand All @@ -13,7 +13,6 @@ import {
GetMyProgramsDocument,
GetProgramDetailsDocument,
} from 'types/__generated__/programsQueries.generated'
import type { ExtendedSession } from 'types/auth'
import { formatDateForInput } from 'utils/dateFormatter'
import { parseCommaSeparated } from 'utils/parser'
import LoadingSpinner from 'components/LoadingSpinner'
Expand Down Expand Up @@ -54,10 +53,9 @@ const EditProgramPage = () => {
return
}

const isAdmin = data.getProgram.admins?.some(
(admin: { login: string }) => admin.login === (session as ExtendedSession)?.user?.login
)

const isAdmin = data.getProgram.admins?.some(
(admin: { login: string }) => admin.login === (session as ExtendedSession)?.user?.login
)
Comment on lines +56 to +58
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did you change indentation here? And I believe the assertion (the issue you needed to fix) is still there 👀

if (isAdmin) {
setAccessStatus('allowed')
} else {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/organizations/page.tsx
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is from a different PR

Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const OrganizationPage = () => {
totalPages={totalPages}
>
<div className="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
{organizations && organizations.map(renderOrganizationCard)}
{organizations?.map(renderOrganizationCard)}
</div>
</SearchPageLayout>
)
Expand Down