first commit
This commit is contained in:
36
frontend/app/utils/api/companyData/gradeApi.ts/index.ts
Normal file
36
frontend/app/utils/api/companyData/gradeApi.ts/index.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { baseApiRequest } from "../../apiRequests/baseApiRequest";
|
||||
import { GradeResponse, GradeResponseDto } from "./type";
|
||||
|
||||
const PROJECT_MANAGEMENT_BASE_URL = `${process.env.NEXT_PUBLIC_PROJECT_MANAGEMENT_API_URL}/api/v1`;
|
||||
|
||||
export const getAllGrade = async (): Promise<GradeResponse> => {
|
||||
return await baseApiRequest(
|
||||
`${PROJECT_MANAGEMENT_BASE_URL}/grades`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
credentials: "include",
|
||||
},
|
||||
{
|
||||
isAccessTokenRequird: true,
|
||||
revalidatePaths: ["/grades"],
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getGradeById = async (id: string): Promise<GradeResponseDto> => {
|
||||
return await baseApiRequest(
|
||||
`${PROJECT_MANAGEMENT_BASE_URL}/grades/${id}`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
credentials: "include",
|
||||
},
|
||||
{
|
||||
isAccessTokenRequird: true,
|
||||
revalidatePaths: [`/grades/${id}`],
|
||||
},
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user