Manage Profile Pages
This commit is contained in:
@@ -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' />;
|
||||
|
||||
Reference in New Issue
Block a user