Skip to content

Commit

Permalink
Revert "feat(user): delete user (#1587)"
Browse files Browse the repository at this point in the history
This reverts commit c8cdb1f.
  • Loading branch information
oyvindgrutle committed Aug 1, 2024
1 parent b62b358 commit ec0a269
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 163 deletions.
74 changes: 0 additions & 74 deletions next-tavla/app/(admin)/components/Footer/components/DeleteUser.tsx

This file was deleted.

58 changes: 0 additions & 58 deletions next-tavla/app/(admin)/components/Footer/components/actions.ts

This file was deleted.

11 changes: 1 addition & 10 deletions next-tavla/app/(admin)/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import { Heading3, Link as EnturLink, Paragraph } from '@entur/typography'
import Link from 'next/link'
import { ExternalIcon, GithubIcon } from '@entur/icons'
import { usePostHog } from 'posthog-js/react'
import { DeleteUser } from './components/DeleteUser'

function Footer({ loggedIn }: { loggedIn: boolean }) {
function Footer() {
const posthog = usePostHog()
return (
<footer className="eds-contrast">
Expand Down Expand Up @@ -82,14 +81,6 @@ function Footer({ loggedIn }: { loggedIn: boolean }) {
<ExternalIcon aria-hidden />
<GithubIcon size={25} aria-hidden />
</div>
{loggedIn && (
<div className="flex flex-row gap-1 items-center">
<EnturLink as={Link} href="?deleteProfile">
Slett bruker
</EnturLink>
<DeleteUser />
</div>
)}
</div>
</div>
</div>
Expand Down
14 changes: 0 additions & 14 deletions next-tavla/app/(admin)/utils/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
getOrganizationIfUserHasAccess,
} from '../actions'
import { getFormFeedbackForError } from '.'
import { getPrivateBoardsForUser } from '../actions'

initializeAdminApp()

Expand Down Expand Up @@ -150,16 +149,3 @@ export async function deleteOrganizationBoard(
if (!access) throw 'auth/operation-not-allowed'
return firestore().collection('boards').doc(bid).delete()
}

export async function deleteUserBoards() {
const user = await getUser()
if (!user) return

const boards = await getPrivateBoardsForUser()

return Promise.all(
boards
.filter((board) => board !== undefined)
.map((board) => board?.id && deleteBoard(board.id)),
)
}
6 changes: 0 additions & 6 deletions next-tavla/app/(admin)/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,6 @@ export function getFormFeedbackForError(
feedback: 'Skriv inn en e-postadresse.',
variant: 'warning',
}
case 'auth/email-mismatch':
return {
form_type: 'email',
feedback: 'E-postadressen stemmer ikke.',
variant: 'error',
}
case 'organization/not-found':
return {
form_type: 'general',
Expand Down
2 changes: 1 addition & 1 deletion next-tavla/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function RootLayout({ children }: { children: ReactNode }) {
<PostHogPageView />
{children}
<FloatingContact />
<Footer loggedIn={loggedIn} />
<Footer />
</body>
</EnturToastProvider>
</PHProvider>
Expand Down

0 comments on commit ec0a269

Please sign in to comment.