Update Versi 1.5.27 #32
@@ -2,6 +2,7 @@ import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
import { prisma } from "@/lib";
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export { GET };
|
||||
|
||||
@@ -84,6 +85,7 @@ async function GET(request: Request) {
|
||||
message: "Berhasil mendapatkan data",
|
||||
data: fixData,
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
backendLogger.error("Error get data job");
|
||||
return NextResponse.json({
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import backendLogger from "@/util/backendLogger";
|
||||
import { NextResponse } from "next/server";
|
||||
import { prisma } from "@/lib";
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export { GET };
|
||||
|
||||
async function GET(request: Request) {
|
||||
export async function GET(request: Request) {
|
||||
try {
|
||||
let fixData;
|
||||
const { searchParams } = new URL(request.url);
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { Job_Arsip } from "@/app_modules/job";
|
||||
|
||||
export default async function Page() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Job_Arsip />
|
||||
<Job_Arsip />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export { apiGetJobByStatus, apiGetJob, apiGetJobArsip, apiGetJobById };
|
||||
export { apiGetJob, apiGetJobArsip, apiGetJobById, apiGetJobByStatus };
|
||||
|
||||
const apiGetJobByStatus = async ({
|
||||
status,
|
||||
@@ -30,7 +30,7 @@ const apiGetJobByStatus = async ({
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => null);
|
||||
console.error(
|
||||
"Error updating portfolio logo:",
|
||||
"Error respone data job:",
|
||||
errorData?.message || "Unknown error"
|
||||
);
|
||||
|
||||
@@ -39,12 +39,18 @@ const apiGetJobByStatus = async ({
|
||||
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error("Error updating portfolio medsos:", error);
|
||||
console.error("Error get data job:", error);
|
||||
throw error; // Re-throw the error to handle it in the calling function
|
||||
}
|
||||
};
|
||||
|
||||
const apiGetJob = async ({ page, search }: { page: string, search?: string }) => {
|
||||
const apiGetJob = async ({
|
||||
page,
|
||||
search,
|
||||
}: {
|
||||
page: string;
|
||||
search?: string;
|
||||
}) => {
|
||||
try {
|
||||
// Fetch token from cookie
|
||||
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
|
||||
@@ -69,7 +75,7 @@ const apiGetJob = async ({ page, search }: { page: string, search?: string }) =>
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => null);
|
||||
console.error(
|
||||
"Error updating portfolio logo:",
|
||||
"Error respone data job:",
|
||||
errorData?.message || "Unknown error"
|
||||
);
|
||||
|
||||
@@ -78,16 +84,12 @@ const apiGetJob = async ({ page, search }: { page: string, search?: string }) =>
|
||||
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error("Error updating portfolio logo:", error);
|
||||
console.error("Error get data job:", error);
|
||||
throw error; // Re-throw the error to handle it in the calling function
|
||||
}
|
||||
};
|
||||
|
||||
const apiGetJobArsip = async ({
|
||||
page,
|
||||
}: {
|
||||
page: string;
|
||||
}) => {
|
||||
const apiGetJobArsip = async ({ page }: { page: string }) => {
|
||||
try {
|
||||
// Fetch token from cookie
|
||||
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
|
||||
@@ -107,20 +109,23 @@ const apiGetJobArsip = async ({
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
// Check if the response is OK
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => null);
|
||||
console.error(
|
||||
"Error updating portfolio logo:",
|
||||
"Error respone data arsip job:",
|
||||
errorData?.message || "Unknown error"
|
||||
);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
const result = await response.json();
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
console.error("Error updating portfolio logo:", error);
|
||||
console.error("Error get data arsip job:", (error as Error).message);
|
||||
throw error; // Re-throw the error to handle it in the calling function
|
||||
}
|
||||
};
|
||||
@@ -148,16 +153,16 @@ const apiGetJobById = async ({ id }: { id: string }) => {
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => null);
|
||||
console.error(
|
||||
"Error updating portfolio logo:",
|
||||
"Error get data job:",
|
||||
errorData?.message || "Unknown error"
|
||||
);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error("Error updating portfolio logo:", error);
|
||||
console.error("Error get data job:", error);
|
||||
throw error; // Re-throw the error to handle it in the calling function
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user