fixed updated or archived - service jobs msg

This commit is contained in:
pramod.mahajan 2025-12-08 11:37:14 +05:30
parent 07ab3314f3
commit 0a82297396
4 changed files with 20 additions and 14 deletions

View File

@ -276,8 +276,7 @@ export const TopicBarChart = ({ data,isLoading }) => {
<div className="col-md-4 d-flex flex-column gap-2"> <div className="col-md-4 d-flex flex-column gap-2">
<div class="card-header d-flex align-items-end justify-content-between"></div> <div class="card-header d-flex align-items-end justify-content-between"></div>
<div className="p-1 m-1 text-start"> <div className="p-1 m-1 text-start">
{/* <p className="fs-5 fs-5">Top Client</p> <small className="fw-medium">Overdue Days</small>
<small> {data.topClient.name}</small> */}
</div> </div>
{/* 030 Days */} {/* 030 Days */}

View File

@ -49,7 +49,7 @@ const ViewBranchDetails = ({ BranchToEdit }) => {
</div> </div>
</div> </div>
<div className="col-md-12 text-start mb-2"> {/* <div className="col-md-12 text-start mb-2">
<div className="d-flex align-items-center"> <div className="d-flex align-items-center">
<label <label
className="form-label me-2 mb-0 fw-semibold" className="form-label me-2 mb-0 fw-semibold"
@ -70,7 +70,7 @@ const ViewBranchDetails = ({ BranchToEdit }) => {
</span> </span>
</> </>
</div> </div>
</div> </div> */}
<div className="col-md-12 text-start mb-3"> <div className="col-md-12 text-start mb-3">
<div className="d-flex align-items-center"> <div className="d-flex align-items-center">
<label <label
@ -112,7 +112,7 @@ const ViewBranchDetails = ({ BranchToEdit }) => {
{data?.contactInformation ? ( {data?.contactInformation ? (
JSON.parse(data.contactInformation).map((contact, index) => ( JSON.parse(data.contactInformation).map((contact, index) => (
<div key={index} className="mb-3"> <div key={index} className="mb-3">
<div className="fw-semibold mb-1">Person {index + 1}:-</div> <div className="text-secondary mb-1">Person {index + 1}</div>
<div> <div>
<label className="fw-semibold mb-1">Person Name:</label> {contact.contactPerson || "N/A"} <label className="fw-semibold mb-1">Person Name:</label> {contact.contactPerson || "N/A"}
</div> </div>
@ -123,7 +123,7 @@ const ViewBranchDetails = ({ BranchToEdit }) => {
<label className="fw-semibold mb-1">Emails:</label> {contact.contactEmails?.join(", ") || "N/A"} <label className="fw-semibold mb-1">Emails:</label> {contact.contactEmails?.join(", ") || "N/A"}
</div> </div>
<div> <div>
<label className="fw-semibold mb-1">Numbers:</label> {contact.contactNumbers?.join(", ") || "N/A"} <label className="fw-semibold mb-1">Number:</label> {contact.contactNumbers?.join(", ") || "N/A"}
</div> </div>
</div> </div>
)) ))

View File

@ -89,7 +89,7 @@ const ManageJob = ({ Job }) => {
})); }));
const updatedEmployees = [...oldEmployees, ...newEmployees]; const updatedEmployees = [...oldEmployees, ...newEmployees];
const payload = [ const payload = [
{ {
op: "replace", op: "replace",
@ -128,6 +128,11 @@ const ManageJob = ({ Job }) => {
value: formData.statusId, value: formData.statusId,
}, },
]; ];
if(payload.length === 0){
showToast("Please change any field value", "warning");
return;
}
UpdateJob({ id: Job, payload }); UpdateJob({ id: Job, payload });
} else { } else {
formData.assignees = formData.assignees.map((emp) => ({ formData.assignees = formData.assignees.map((emp) => ({

View File

@ -274,17 +274,19 @@ export const useUpdateServiceProjectJob = (onSuccessCallback) => {
return { resp, isArchiveAction }; return { resp, isArchiveAction };
}, },
onSuccess: ({ isArchiveAction }) => { onSuccess: (data, variable) => {
queryClient.invalidateQueries({ queryKey: ["serviceProjectJobs"] }); queryClient.invalidateQueries({ queryKey: ["serviceProjectJobs"] });
queryClient.invalidateQueries({ queryKey: ["service-job"] }); queryClient.invalidateQueries({ queryKey: ["service-job"] });
if (variable.payload.length >= 1) {
if (onSuccessCallback) onSuccessCallback(); showToast("Job Updated successfully", "success");
if (isArchiveAction) {
showToast("Job archived successfully", "success");
} else { } else {
showToast("Job restored successfully", "success"); if (variable.isArchiveAction) {
showToast("Job archived successfully", "success");
} else {
showToast("Job restored successfully", "success");
}
} }
if (onSuccessCallback) onSuccessCallback();
}, },
onError: (error) => { onError: (error) => {