Add HR agent onboarding model and actor enforcement
This commit is contained in:
@@ -1,3 +1,17 @@
|
||||
|
||||
function getActorId(): string | undefined {
|
||||
if (typeof window !== "undefined") {
|
||||
const stored = window.localStorage.getItem("actor_employee_id");
|
||||
if (stored) return stored;
|
||||
const env = process.env.NEXT_PUBLIC_ACTOR_EMPLOYEE_ID;
|
||||
if (env) {
|
||||
window.localStorage.setItem("actor_employee_id", env);
|
||||
return env;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
return process.env.NEXT_PUBLIC_ACTOR_EMPLOYEE_ID;
|
||||
}
|
||||
export async function customFetch<T>(
|
||||
url: string,
|
||||
options: RequestInit,
|
||||
@@ -9,6 +23,7 @@ export async function customFetch<T>(
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...(getActorId() ? { "X-Actor-Employee-Id": String(getActorId()) } : {}),
|
||||
...(options.headers ?? {}),
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user