Add HR agent onboarding model and actor enforcement

This commit is contained in:
Abhimanyu Saharan
2026-02-02 01:36:32 +05:30
parent d18a38e666
commit 886db3fa97
15 changed files with 781 additions and 38 deletions

View File

@@ -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 ?? {}),
},
});