Further cleanup of components for subscription use
This commit is contained in:
@@ -38,7 +38,7 @@ class AppContainer extends Component {
|
||||
// split based on operation type
|
||||
({ query }) => {
|
||||
const definition = getMainDefinition(query);
|
||||
console.log("000000", definition.operation);
|
||||
console.log("##Intercepted GQL Transaction##", query);
|
||||
return (
|
||||
definition.kind === "OperationDefinition" &&
|
||||
definition.operation === "subscription"
|
||||
|
||||
@@ -64,7 +64,7 @@ export default () => {
|
||||
mutation: UPSERT_USER,
|
||||
variables: { authEmail: user.email, authToken: user.uid }
|
||||
})
|
||||
.then(r => console.log("Successful Upsert", r))
|
||||
.then()
|
||||
.catch(error => {
|
||||
console.log("Upsert error!!!!", error);
|
||||
});
|
||||
|
||||
@@ -12,16 +12,12 @@ class SignInForm extends React.Component {
|
||||
|
||||
handleSubmit = e => {
|
||||
e.preventDefault();
|
||||
const { apolloClient } = this.props;
|
||||
|
||||
this.props.form.validateFields(async (err, values) => {
|
||||
if (!err) {
|
||||
const { email, password } = values;
|
||||
try {
|
||||
const { user } = await auth.signInWithEmailAndPassword(
|
||||
email,
|
||||
password
|
||||
);
|
||||
await auth.signInWithEmailAndPassword(email, password);
|
||||
|
||||
this.props.form.resetFields();
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { Component } from "react";
|
||||
import { Redirect } from "react-router-dom";
|
||||
//import { Redirect } from "react-router-dom";
|
||||
import firebase from "../../firebase/firebase.utils";
|
||||
export default class SignOut extends Component {
|
||||
state = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { gql } from "apollo-boost";
|
||||
|
||||
export const GET_ALL_OPEN_JOBS = gql`
|
||||
query {
|
||||
{
|
||||
jobs {
|
||||
id
|
||||
est_number
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React from "react";
|
||||
import { useQuery, useSubscription } from "@apollo/react-hooks";
|
||||
import AlertComponent from "../../components/alert/alert.component";
|
||||
//import { GET_ALL_OPEN_JOBS } from "../../graphql/jobs.queries";
|
||||
import { Table, Divider, Icon } from "antd";
|
||||
|
||||
@@ -76,9 +77,7 @@ export default function JobsPage() {
|
||||
];
|
||||
|
||||
//if (loading) return "Loading";
|
||||
if (error) return `Error! ${error.message}`;
|
||||
//console.log("$$$Develop (jobs.page.jsx) | jobs", jobs);
|
||||
console.log("JobsPage Rendering...");
|
||||
if (error) return <AlertComponent message={error.message} />;
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user