Skip to content

Commit

Permalink
Merge pull request #5309 from bcgov/dev-marshal-AS-communications
Browse files Browse the repository at this point in the history
Toast added for response
  • Loading branch information
aparna-aot authored Jul 8, 2024
2 parents d1146bf + c0dc528 commit 54dc6e9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ export default function AttachmentModal({
{uploadFor === "email" ? "Save Changes" :"Continue"}
</button>
)}
<button className="btn-bottom btn-cancel" onClick={handleClose}>
<button className="btn-cancel" onClick={handleClose}>
Cancel
</button>
</DialogActions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,19 @@ export const ContactApplicant = ({
setPreviewModal(false);
const responseattachments = await saveAttachments(_files);
let callback = (_res: string) => {
const toastID = toast.loading("Saving response...")
toast.update(toastID, {
type: "success",
render: "Response successfully saved.",
position: "top-right",
isLoading: false,
autoClose: 3000,
hideProgressBar: true,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
});
clearcorrespondence();
changeCorrespondenceFilter("log");
dispatch(fetchApplicantCorrespondence(requestId, ministryId));
Expand All @@ -501,6 +514,19 @@ export const ContactApplicant = ({
dispatch,
callback,
(errorMessage: string) => {
const toastID = toast.loading("Saving response...")
toast.update(toastID, {
type: errorMessage ? "error" : "success",
render: errorMessage ? "Response upload failed" : "Response successfully saved.",
position: "top-right",
isLoading: false,
autoClose: 3000,
hideProgressBar: true,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
});
clearcorrespondence();
changeCorrespondenceFilter("log");
dispatch(fetchApplicantCorrespondence(requestId, ministryId));
Expand Down

0 comments on commit 54dc6e9

Please sign in to comment.