19 lines
629 B
JavaScript
19 lines
629 B
JavaScript
import React from "react";
|
|
import JobLinesComponent from "./job-lines.component";
|
|
import { useQuery } from "@apollo/react-hooks";
|
|
import AlertComponent from "../alert/alert.component";
|
|
|
|
import { GET_JOB_LINES_BY_PK } from "../../graphql/jobs-lines.queries";
|
|
|
|
export default function JobLinesContainer({ jobId }) {
|
|
|
|
const { loading, error, data } = useQuery(GET_JOB_LINES_BY_PK, {
|
|
variables: { id: jobId },
|
|
fetchPolicy: "network-only"
|
|
});
|
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
|
return (
|
|
<JobLinesComponent loading={loading} joblines={data ? data.joblines : null} />
|
|
);
|
|
}
|
|
|