diff --git a/src/modules/login/LoginPage.tsx b/src/modules/login/LoginPage.tsx index 2f7c589a..75084d86 100644 --- a/src/modules/login/LoginPage.tsx +++ b/src/modules/login/LoginPage.tsx @@ -3,9 +3,8 @@ import { Button, Form, Message, Segment } from "semantic-ui-react"; import { Link, withRouter } from "react-router-dom"; import { History } from "history"; import { Mutation } from "@apollo/client/react/components"; -import { gql } from "@apollo/client"; +import { ApolloError, gql } from "@apollo/client"; -import { GraphQLError } from "graphql"; import { PATH_CHOOSE_TEAM, PATH_FORGOT_PASSWORD, @@ -44,7 +43,7 @@ export interface LoginResult { id: string; }; }; - errors: GraphQLError[]; + errors: ApolloError[]; }; } @@ -93,7 +92,7 @@ class LoginPage extends Component { this.props.history.push(PATH_CHOOSE_TEAM); } else { - this.setState({ error: getGraphqlError(data.signInUser.errors) }); + this.setState({ error: "Something went wrong." }); } } diff --git a/src/modules/manage-team/sections/kudometer/goals/EditGoal.tsx b/src/modules/manage-team/sections/kudometer/goals/EditGoal.tsx index d7b2fb68..650564ff 100644 --- a/src/modules/manage-team/sections/kudometer/goals/EditGoal.tsx +++ b/src/modules/manage-team/sections/kudometer/goals/EditGoal.tsx @@ -2,7 +2,7 @@ import { Mutation } from "@apollo/client/react/components"; import { toast } from "react-toastify"; import { Button, Form, Message } from "semantic-ui-react"; import React, { ChangeEvent } from "react"; -import { GraphQLError } from "graphql"; + import { CREATE_GOAL, CreateGoalParameters, @@ -12,6 +12,7 @@ import { import settings from "../../../../../config/settings"; import { getGraphqlError } from "../../../../../support"; import { Storage } from "../../../../../support/storage"; +import { ApolloError } from "@apollo/client"; export interface EditGoalProps { kudometerId: string; @@ -77,7 +78,7 @@ export class EditGoal extends React.Component { }).catch(this.handleError); } - handleError(error: GraphQLError) { + handleError(error: ApolloError) { const displayError = getGraphqlError(error); this.setState({ @@ -98,7 +99,7 @@ export class EditGoal extends React.Component { toast.info( this.state.editing ? "Goal updated successfully!" - : "Goal created successfully!" + : "Goal created successfully!", ); this.setState({ goalName: "",