Merge pull request #424 from bipproduction/amalia/16-apr-25

fix: load refresh notifikasi list
This commit is contained in:
Amalia
2025-04-16 14:45:50 +08:00
committed by GitHub
2 changed files with 10 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
export async function GET(request: Request) {
try {
return NextResponse.json({ success: true, version: "1.3.3", tahap: "beta", update: "- update baru : menampilkan notifikasi pengumuman setelah login (fixed tampilan); - rich text di pengumuman (tambah dan edit); - fitur tandai dibaca semua notifikasi" }, { status: 200 });
return NextResponse.json({ success: true, version: "1.3.4", tahap: "beta", update: "- update baru : menampilkan notifikasi pengumuman setelah login (fixed tampilan); - rich text di pengumuman (tambah dan edit); - fitur tandai dibaca semua notifikasi" }, { status: 200 });
} catch (error) {
console.error(error);
return NextResponse.json({ success: false, version: "Gagal mendapatkan version, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });

View File

@@ -49,7 +49,15 @@ export default function ListNotification() {
useShallowEffect(() => {
fetchData(false);
}, [isPage, reloadNotif.get()]);
}, [isPage]);
useShallowEffect(() => {
if (isPage != 1) {
setPage(1)
} else {
fetchData(false)
}
}, [reloadNotif.get()]);
useEffect(() => {
const handleScroll = async () => {