From e75c2c624834e2806fe096abb8321f7e1c4570f4 Mon Sep 17 00:00:00 2001 From: Subramani E Date: Mon, 2 Dec 2024 13:31:11 +0530 Subject: [PATCH] fixed bug of not showing nickname --- .../src/components/ProtectedRoute.jsx | 1 + .../web-admin/src/layouts/DashboardLayout.jsx | 14 +++++--- packages/database/prisma/schema.prisma | 32 +++++++++++++------ 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/apps/web-admin/src/components/ProtectedRoute.jsx b/apps/web-admin/src/components/ProtectedRoute.jsx index 4137e671..2c97bb73 100644 --- a/apps/web-admin/src/components/ProtectedRoute.jsx +++ b/apps/web-admin/src/components/ProtectedRoute.jsx @@ -88,6 +88,7 @@ export const ProtectedRoute = ({ children }) => { ...preValue, role: response.data.data.role, orgId: response.data.data.organizationId, + name: user.nickname, })); }); // const { mutate: postOrg } = usePostMutation('/core/organizations', { diff --git a/apps/web-admin/src/layouts/DashboardLayout.jsx b/apps/web-admin/src/layouts/DashboardLayout.jsx index 23c1f63d..9de072a1 100644 --- a/apps/web-admin/src/layouts/DashboardLayout.jsx +++ b/apps/web-admin/src/layouts/DashboardLayout.jsx @@ -1,5 +1,5 @@ import { useRouter } from 'next/router'; -import { useState, useContext } from 'react'; +import { useState, useContext, useEffect } from 'react'; import { Box, useMediaQuery, Flex, Text, Button, useDisclosure } from '@chakra-ui/react'; import { IoMdArrowRoundBack } from 'react-icons/io'; import { RxHamburgerMenu } from 'react-icons/rx'; @@ -17,7 +17,9 @@ export default function DashboardLayout({ headerButton, children }) { const [isSidebarOpen, setSidebarOpen] = useState(isMobile); const { user, isAuthenticated, isLoading } = useAuth0(); const { isOpen, onOpen, onClose } = useDisclosure(); // useDisclosure hook for modal - + useEffect(() => { + console.log(router.asPath); + }, [router.asPath]); if (isAuthenticated) { return ( @@ -66,7 +68,11 @@ export default function DashboardLayout({ headerButton, children }) { { router.back(); }} @@ -78,7 +84,7 @@ export default function DashboardLayout({ headerButton, children }) { width={50} style={{ cursor: 'pointer' }} onClick={() => { - router.push(`/${accountDetails?.orgId}`); + router.push(`/${accountDetails?.orgId}/events`); }} /> diff --git a/packages/database/prisma/schema.prisma b/packages/database/prisma/schema.prisma index 002cb40d..e12c52f9 100644 --- a/packages/database/prisma/schema.prisma +++ b/packages/database/prisma/schema.prisma @@ -32,6 +32,17 @@ enum Role { model Organization { id String @id name String + Logo String? + Tagline String? + Description String? + addressId String? + phoneNo String? + email String? + website String? + twitterLink String? + instagramLink String? + linkedInLink String? + Address Address? @relation(fields: [addressId], references: [id]) OrganizationUser OrganizationUser[] Event Event[] Participant Participant[] @@ -52,15 +63,16 @@ model OrganizationUser { user User @relation(fields: [userId], references: [id]) } -model Venue { - id String @id @default(uuid()) - name String? - city String? - state String? - country String? - pinCode Int? - locationUrl String? - Event Event[] +model Address { + id String @id @default(uuid()) + name String? + city String? + state String? + country String? + pinCode Int? + locationUrl String? + Organization Organization[] + Event Event[] } model Event { @@ -75,7 +87,7 @@ model Event { organizationId String venueId String? organization Organization @relation(fields: [organizationId], references: [id]) - venue Venue? @relation(fields: [venueId], references: [id]) + address Address? @relation(fields: [venueId], references: [id]) Participant Participant[] ParticipantCheckin ParticipantCheckIn[] attributes Attributes[]