fix : job
deskripsi: - page: job-vacancy untuk non user sudah bisa di akses kembali - tidak menggunakan use server lagi melainkan API
This commit is contained in:
16
src/app_modules/_global/lib/api_fetch_not_user.tsx
Normal file
16
src/app_modules/_global/lib/api_fetch_not_user.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
export async function apiGetNotUserForJob({ id }: { id: string }) {
|
||||
try {
|
||||
const response = await fetch(`/api/not-user/job/${id}`);
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => null);
|
||||
console.error("Failed to get job", response.statusText, errorData);
|
||||
throw new Error(errorData?.message || "Failed to get job");
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.error("Error get job:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user