Commit 375ef811 authored by Nitin Jadhav's avatar Nitin Jadhav
Browse files

Merge branch 'jobs-email-links-fix' into 'master'

Jobs email links fix

See merge request !90
parents 405175ea 5ee4d68a
Pipeline #280456 passed with stages
in 4 minutes and 35 seconds
......@@ -40,9 +40,7 @@ export function App() {
<Route
path="/alerts/alert-email/:jobRef"
render={({ match }) => (
<EmailAlertRedirects jobId={match.params.jobRef} />
)}
element={<EmailAlertRedirects />}
/>
<Route path="/alerts" element={<Alerts />} />
......
......@@ -3,14 +3,16 @@ import { Navigate } from "react-router-dom";
import { useFetchJobsList } from "../../services/useFetchJobsList";
import { VFLoaderBox } from "component-templates/VFLoader/VFLoader";
import { JobNotFound } from "components/job-details/JobDetails";
import { useParams } from "react-router";
/* Raison d'être of this component is to Navigate users that come from email alerts to actual job page */
export default function EmailAlertNavigates({ jobId }) {
export default function EmailAlertNavigates() {
const { jobRef } = useParams();
const { filteredJobs, loading, error } = useFetchJobsList();
const [job, setJob] = useState();
useEffect(() => {
if (filteredJobs && filteredJobs.length) {
const foundJob = filteredJobs.find((job) => job.id === jobId);
const foundJob = filteredJobs.find((job) => job.id === jobRef);
setJob(foundJob);
}
}, [filteredJobs]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment