Cleanup database + updates to apollo error handler to check all errors + added hash history to jobs list.

This commit is contained in:
Patrick Fic
2020-01-22 14:45:10 -08:00
parent 4bac820887
commit 42505ad74e
25 changed files with 1803 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ import JobsList from "../../components/jobs-list/jobs-list.component";
import JobDetailCards from "../../components/job-detail-cards/job-detail-cards.component";
//TODO: Implement pagination for this.
export default function JobsPage() {
export default function JobsPage({ match, location }) {
const { loading, error, data } = useSubscription(SUBSCRIPTION_ALL_OPEN_JOBS, {
fetchPolicy: "network-only"
});
@@ -18,9 +18,11 @@ export default function JobsPage() {
document.title = t("titles.jobs");
}, [t]);
const [selectedJob, setSelectedJob] = useState(null);
const { hash } = location;
const [selectedJob, setSelectedJob] = useState(hash ? hash.substr(1) : null);
console.log("Jobs Page Render.");
if (error) return <AlertComponent message={error.message} />;
if (error) return <AlertComponent message={error.message} type='error' />;
return (
<Col span={22} offset={1}>
<JobsList