Track cleanup progress and polish profile/system flows
This commit is contained in:
@@ -18,7 +18,7 @@ import {
|
||||
Typography,
|
||||
} from "@mui/material";
|
||||
|
||||
import { api } from "../api";
|
||||
import { api, getApiErrorMessage } from "../api";
|
||||
import { ApplicationPackageResponse, CandidateFit, InterviewPrepResponse, JobApplication, ReadinessResponse } from "../types";
|
||||
import { useToast } from "../toast";
|
||||
import { useDialogActions } from "../dialogs";
|
||||
@@ -216,7 +216,7 @@ export default function JobDetailsDialog({ open, jobId, onClose }: Props) {
|
||||
setJob(res.data);
|
||||
toast("Summary and skills refreshed.", "success");
|
||||
} catch (error: any) {
|
||||
toast(error?.response?.data || "Failed to refresh summary and skills.", "error");
|
||||
toast(getApiErrorMessage(error, "Failed to refresh summary and skills."), "error");
|
||||
} finally {
|
||||
setRefreshingAi(false);
|
||||
}
|
||||
@@ -277,7 +277,7 @@ export default function JobDetailsDialog({ open, jobId, onClose }: Props) {
|
||||
setTailoredCvText(res.data.tailoredCvText ?? "");
|
||||
toast("Application package generated.", "success");
|
||||
} catch (error: any) {
|
||||
toast(error?.response?.data || "Failed to generate application package.", "error");
|
||||
toast(getApiErrorMessage(error, "Failed to generate application package."), "error");
|
||||
} finally {
|
||||
setGeneratingPackage(false);
|
||||
}
|
||||
@@ -294,7 +294,7 @@ export default function JobDetailsDialog({ open, jobId, onClose }: Props) {
|
||||
setInterviewPrep(null);
|
||||
toast("Tailored CV saved.", "success");
|
||||
} catch (error: any) {
|
||||
toast(error?.response?.data || "Failed to save tailored CV.", "error");
|
||||
toast(getApiErrorMessage(error, "Failed to save tailored CV."), "error");
|
||||
} finally {
|
||||
setSavingTailoredCv(false);
|
||||
}
|
||||
@@ -317,7 +317,7 @@ export default function JobDetailsDialog({ open, jobId, onClose }: Props) {
|
||||
setReadiness(null);
|
||||
toast("Cover letter saved to this job.", "success");
|
||||
} catch (error: any) {
|
||||
toast(error?.response?.data || "Failed to save cover letter.", "error");
|
||||
toast(getApiErrorMessage(error, "Failed to save cover letter."), "error");
|
||||
} finally {
|
||||
setSavingApplicationDrafts(false);
|
||||
}
|
||||
@@ -330,7 +330,7 @@ export default function JobDetailsDialog({ open, jobId, onClose }: Props) {
|
||||
setReadiness(null);
|
||||
toast("Application answer saved to notes.", "success");
|
||||
} catch (error: any) {
|
||||
toast(error?.response?.data || "Failed to save application answer.", "error");
|
||||
toast(getApiErrorMessage(error, "Failed to save application answer."), "error");
|
||||
} finally {
|
||||
setSavingApplicationDrafts(false);
|
||||
}
|
||||
@@ -343,7 +343,7 @@ export default function JobDetailsDialog({ open, jobId, onClose }: Props) {
|
||||
setJob((prev) => prev ? { ...prev, recruiterMessageDraft: content } : prev);
|
||||
toast("Recruiter message saved to this job.", "success");
|
||||
} catch (error: any) {
|
||||
toast(error?.response?.data || "Failed to save recruiter message.", "error");
|
||||
toast(getApiErrorMessage(error, "Failed to save recruiter message."), "error");
|
||||
} finally {
|
||||
setSavingApplicationDrafts(false);
|
||||
}
|
||||
@@ -374,7 +374,7 @@ export default function JobDetailsDialog({ open, jobId, onClose }: Props) {
|
||||
setReadiness(null);
|
||||
toast("Follow-up sent and logged.", "success");
|
||||
} catch (error: any) {
|
||||
toast(error?.response?.data || "Failed to send follow-up.", "error");
|
||||
toast(getApiErrorMessage(error, "Failed to send follow-up."), "error");
|
||||
} finally {
|
||||
setSendingDraft(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user