Manage Profile Pages

This commit is contained in:
Patrick Fic
2020-01-06 15:42:16 -08:00
parent 1e24f8679a
commit b51b2d2b76
16 changed files with 264 additions and 101 deletions

View File

@@ -1,5 +1,5 @@
import React, { useEffect } from "react";
import { useSubscription } from "@apollo/react-hooks";
import { useQuery } from "@apollo/react-hooks";
import SpinComponent from "../../components/loading-spinner/loading-spinner.component";
import AlertComponent from "../../components/alert/alert.component";
import JobTombstone from "../../components/job-tombstone/job-tombstone.component";
@@ -11,7 +11,7 @@ import { useTranslation } from "react-i18next";
function JobsDetailPage({ match }) {
const { jobId } = match.params;
const { t } = useTranslation();
const { loading, error, data } = useSubscription(GET_JOB_BY_PK, {
const { loading, error, data } = useQuery(GET_JOB_BY_PK, {
variables: { id: jobId },
fetchPolicy: "network-only"
});
@@ -22,7 +22,7 @@ function JobsDetailPage({ match }) {
: t("titles.jobsdetail", {
ro_number: data.jobs_by_pk.ro_number
});
}, [loading]);
}, [loading,data,t]);
if (loading) return <SpinComponent />;
if (error) return <AlertComponent message={error.message} type='error' />;