update performance, manual attendance, redownload leave form

Added the ability to view and re-download leave application forms in the Employee History page (Leave, Permit, and Sick tabs)
Added employee alpha stats and employee alpha detail in Employee Performance Page
Added total WFO, WFH and WFS in Admin Summary Report
Added batch import from Excel files in Admin Manual Attendance
This commit is contained in:
Ichsan Kurniawan
2026-02-20 15:19:42 +07:00
parent d09799068d
commit 5a3629badf
54 changed files with 963 additions and 122 deletions
+5
View File
@@ -2,6 +2,7 @@ import { getServerSession } from "next-auth"
import { authOptions } from "@/pages/api/auth/[...nextauth]"
import { redirect } from "next/navigation"
import { ResponseData } from "@/types/types"
import { logger } from "./logger"
export default async function fetchData(url: string = '/', cache: "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" = 'default', next?: NextFetchRequestConfig) {
const { BASE_URL_API } = process.env
@@ -20,6 +21,8 @@ export default async function fetchData(url: string = '/', cache: "default" | "f
// Recommendation: handle errors
if (!res.ok) {
logger.error(`ERROR FETCH DATA. http error: ${JSON.stringify(res)}. detail error: ${data}`);
console.log("FETCH ERROR DATA :", res.status, data)
if (res.status === 401 || res.status === 403) return redirect(`/auth?error=Session error or has expired !`)
// This will activate the closest `error.js` Error Boundary
@@ -56,6 +59,8 @@ export async function fetchDataWithPost(url: string = '/', payload: any = {}, ca
}
if (!res.ok) {
logger.error(`ERROR FETCH DATA. http error: ${JSON.stringify(res)}. detail error: ${data}`);
console.log("FETCH ERROR DATA :", res.status, data)
if (res.status === 401 || res.status === 403) redirect(`/auth?error=Session error or has expired !`);