feat: enhance project and mentor management features

- Updated MentorProjectCard to provide more detailed success/error messages upon archiving and completing projects.
- Adjusted layout for certificate generation to improve visual alignment.
- Introduced resolveErrorMessage utility to standardize error message handling across the application.
- Enhanced customToast functionality to handle hook failures more gracefully.
- Refactored useCertificates hook to return structured responses for certificate claims and generation.
- Updated useMentors hook to improve error handling and response structure for mentor operations.
- Improved useNotification hook to return structured responses for marking notifications as read.
- Refactored useProjects hook to provide structured responses for project creation, updates, and member assignments.
- Enhanced useTasks hook to return structured responses for task creation, updates, and deletions.
- Updated services to return structured responses with messages for various API calls related to certificates, mentors, notifications, projects, tasks, and user management.
- Moved mentor-related types to a dedicated user.types file for better organization.
This commit is contained in:
Kemas M. Aryadary Rasyad
2026-07-16 22:50:56 +07:00
parent 99082efbdb
commit 62aaf2bcba
34 changed files with 408 additions and 425 deletions
+5 -5
View File
@@ -6,7 +6,7 @@ import UpdateProfileDialog from "./UpdateProfileDialogue";
export default function SettingsPage() {
const { user, loading: userLoading } = useCurrentUser();
const { save, loading: saving, msgRef } = useUpdateProfile();
const { save, loading: saving } = useUpdateProfile();
const [confirmOpen, setConfirmOpen] = useState(false);
const isIntern = user?.role === "intern";
@@ -93,15 +93,15 @@ export default function SettingsPage() {
}),
{
loading: "Menyimpan perubahan...",
success: () => ({
success: (updated) => ({
title: "Perubahan berhasil disimpan!",
description: emailChanged
? "Email berubah, silakan login ulang..."
: msgRef.current.success ?? "",
: updated.message
}),
error: () => ({
error: (err) => ({
title: "Gagal menyimpan perubahan!",
description: msgRef.current.error ?? "",
description: err.message ?? "",
}),
}
);