update opengraph

This commit is contained in:
Ichsan Kurniawan
2026-02-09 16:22:14 +07:00
parent 5cbded392a
commit 09ad78ed03
10 changed files with 7 additions and 15 deletions
+2
View File
@@ -20,6 +20,7 @@ export default async function fetchData(url: string = '/', cache: "default" | "f
// Recommendation: handle errors
if (!res.ok) {
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
throw new Error(`(${data.code || res.status}) ${data.message || res.statusText}`)
@@ -55,6 +56,7 @@ export async function fetchDataWithPost(url: string = '/', payload: any = {}, ca
}
if (!res.ok) {
console.log("FETCH ERROR DATA :", res.status, data)
if (res.status === 401 || res.status === 403) redirect(`/auth?error=Session error or has expired !`);
throw new Error(`(${data?.code || res.status} ${res.statusText}) ${data?.message}`);