Skip to content

Commit

Permalink
update: orgId layout page.
Browse files Browse the repository at this point in the history
  • Loading branch information
yashdev9274 committed May 20, 2024
1 parent 08e9ef1 commit 2f69733
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions src/app/(main)/agency/[agencyId]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Sidebar from '@/components/sidebar'
import Unauthorized from '@/components/unauthorized'
import { verifyAndAcceptInvitation } from '@/lib/queries'
import { getNotificationAndUser, verifyAndAcceptInvitation } from '@/lib/queries'
import { currentUser } from '@clerk/nextjs'
import { redirect } from "next/navigation"
import React from 'react'
Expand Down Expand Up @@ -28,8 +29,20 @@ const layout = async ({ children, params }: Props) => {
)
return <Unauthorized />

let allNoti: any = []
const notifications = await getNotificationAndUser(agencyId)
if (notifications) allNoti = notifications

return (
<div>layout</div>
<div className='h-screen overflow-hidden'>
<Sidebar
id={params.agencyId}
type="agency"
/>
<div className='md:pl-[300px]'>

</div>
</div>
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export const getNotificationAndUser = async (agencyId: string) => {
where: { agencyId },
include: { User: true },
orderBy: {
createdAt: 'desc'
createdAt: 'desc' // ordering in descending order
}
})
return response
Expand Down

0 comments on commit 2f69733

Please sign in to comment.