fix: fixed api in inbox
This commit is contained in:
parent
996a8db8ae
commit
d3c9e642c6
|
|
@ -96,12 +96,23 @@ const Navbar = () => {
|
||||||
setNotifications(response?.data?.data?.content);
|
setNotifications(response?.data?.data?.content);
|
||||||
console.log("respon:", response);
|
console.log("respon:", response);
|
||||||
}
|
}
|
||||||
|
if (roleId != undefined) {
|
||||||
|
const response = await getUserNotifications(0, 3);
|
||||||
|
setNotifications(response?.data?.data?.content);
|
||||||
|
console.log("respon:", response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getNotifUpdate() {
|
async function getNotifUpdate() {
|
||||||
|
if (roleId != undefined) {
|
||||||
|
const response = await getUserNotifications(0, 2);
|
||||||
|
setNotificationsUpdate(response?.data?.data?.content);
|
||||||
|
console.log("Notiffff:", response);
|
||||||
|
}
|
||||||
if (roleId != undefined) {
|
if (roleId != undefined) {
|
||||||
const response = await getUserNotifications(0, 3);
|
const response = await getUserNotifications(0, 3);
|
||||||
setNotificationsUpdate(response?.data?.data?.content); // console.log("respon:", response);
|
setNotificationsUpdate(response?.data?.data?.content);
|
||||||
|
console.log("Notiffff:", response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -379,7 +390,7 @@ const Navbar = () => {
|
||||||
<Icon icon="basil:envelope-outline" color="black" width="30" />
|
<Icon icon="basil:envelope-outline" color="black" width="30" />
|
||||||
</a>
|
</a>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
<PopoverContent className=" p-0 h-32 flex flex-col mt-2" align="end">
|
<PopoverContent className=" p-0 flex flex-col mt-2" align="end">
|
||||||
<Tabs value={selectedTab} onValueChange={setSelectedTab} className="flex flex-row">
|
<Tabs value={selectedTab} onValueChange={setSelectedTab} className="flex flex-row">
|
||||||
<TabsList className="grid grid-cols-2 lg:flex lg:flex-row ">
|
<TabsList className="grid grid-cols-2 lg:flex lg:flex-row ">
|
||||||
<TabsTrigger value="notif-tab">
|
<TabsTrigger value="notif-tab">
|
||||||
|
|
@ -411,11 +422,11 @@ const Navbar = () => {
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
</TabsList>
|
</TabsList>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
<div className={`flex justify-center my-3 ${isMessageActive ? "active" : ""}`}>
|
<div className={`flex flex-col justify-center my-3 ${isMessageActive ? "active" : ""}`}>
|
||||||
{notifications?.map((list: any) => (
|
{notifications?.map((list: any) => (
|
||||||
<a className="" href={list.redirectUrl} key={list.id}>
|
<a className="flex flex-row" href={list.redirectUrl} key={list.id}>
|
||||||
<div className="">
|
<div className="">
|
||||||
<img src="/assets/avatar-profile.png" alt="..." className="" />
|
<img src="/assets/avatar-profile.png" alt="..." className="w-8 items-center mr-3" />
|
||||||
</div>
|
</div>
|
||||||
<div className="">
|
<div className="">
|
||||||
<div className="text-wrap text-left">{list?.message}</div>
|
<div className="text-wrap text-left">{list?.message}</div>
|
||||||
|
|
@ -430,7 +441,7 @@ const Navbar = () => {
|
||||||
</a>
|
</a>
|
||||||
))}
|
))}
|
||||||
<Link href="/inbox" legacyBehavior>
|
<Link href="/inbox" legacyBehavior>
|
||||||
<p className="text-[15px] py-2" role="button">
|
<p className="text-[15px] text-center py-2" role="button">
|
||||||
Lihat semua
|
Lihat semua
|
||||||
</p>
|
</p>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue