feat: update certificate handling and project management features
- Refactored CertificateHistory component to display dynamic certificate images. - Modified CertificateNotAvailable component text for clarity on certificate publication. - Enhanced CertificateForm to include file preview and clear functionality for uploaded images. - Removed obsolete CertificatePage component to streamline mentor interface. - Updated CertificateResult to handle project details and loading states more effectively. - Improved HomeMentorPage structure by adjusting imports for better organization. - Enhanced EligibleInternTable with navigation to results and improved error handling for certificate generation. - Updated HomeMentorProject styles for consistency with design system. - Added utility function to resolve image URLs for certificates. - Introduced new hooks for generating certificates and managing notifications. - Expanded project service functions to include project completion and assignable interns retrieval. - Updated types for certificates and projects to reflect new data structures. - Added user types for better type safety in user management.
This commit is contained in:
@@ -9,7 +9,8 @@ import type {
|
||||
UpdateProjectPayload,
|
||||
AssignMemberPayload,
|
||||
MemberAssignment,
|
||||
ProjectMember
|
||||
ProjectMember,
|
||||
AssignableIntern
|
||||
} from "../types/project.types";
|
||||
|
||||
// POST /project-api/add
|
||||
@@ -84,6 +85,14 @@ export const archiveProject = async (
|
||||
return res.data.data;
|
||||
};
|
||||
|
||||
|
||||
export const completeProject = async (
|
||||
id: string | number
|
||||
): Promise<ProjectDetail> => {
|
||||
const res = await api.post(`/project-api/complete/${id}`);
|
||||
return res.data.data;
|
||||
};
|
||||
|
||||
// GET /project-api/my-projects (intern only)
|
||||
export const getMyProjects = async (): Promise<ProjectDetail[]> => {
|
||||
const res = await api.get("/project-api/my-projects");
|
||||
@@ -108,6 +117,12 @@ export const getAllInterns = async (): Promise<InternDetail[]> => {
|
||||
return res.data.data;
|
||||
};
|
||||
|
||||
// GET /project-api/assignable-interns
|
||||
export const getAssignableInterns = async (): Promise<AssignableIntern[]> => {
|
||||
const res = await api.get("/project-api/assignable-interns");
|
||||
return res.data.data;
|
||||
}
|
||||
|
||||
// POST /project-api/assign-member (admin/mentor only)
|
||||
export const assignMember = async (
|
||||
payload: AssignMemberPayload
|
||||
|
||||
Reference in New Issue
Block a user