first commit
This commit is contained in:
43
frontend/app/utils/api/employeeDetails/index.tsx
Normal file
43
frontend/app/utils/api/employeeDetails/index.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
import { baseApiRequest } from "../apiRequests/baseApiRequest";
|
||||
|
||||
const PROJECT_API = `${process.env.NEXT_PUBLIC_PROJECT_MANAGEMENT_API_URL}/api/v1`;
|
||||
// const USER_API =
|
||||
// "https://ikoncloud-dev.keross.com/ikon-api/platform/user/current";
|
||||
|
||||
// READ
|
||||
export const getGrades = async () => {
|
||||
return baseApiRequest(
|
||||
`${PROJECT_API}/grades`,
|
||||
{
|
||||
method: "GET",
|
||||
cache: "no-store",
|
||||
},
|
||||
{ isAccessTokenRequird: true },
|
||||
);
|
||||
};
|
||||
|
||||
export const getRoles = async () => {
|
||||
return baseApiRequest(
|
||||
`${PROJECT_API}/roles`,
|
||||
{
|
||||
method: "GET",
|
||||
cache: "no-store",
|
||||
},
|
||||
{ isAccessTokenRequird: true },
|
||||
);
|
||||
};
|
||||
|
||||
export const getEmployees = async () => {
|
||||
return baseApiRequest(
|
||||
`${PROJECT_API}/employees`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
credentials: "include",
|
||||
},
|
||||
{
|
||||
isAccessTokenRequird: true,
|
||||
revalidatePaths: ["/roles"],
|
||||
},
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user