Images upload as resized images. Added location hash for jobs detail page.

This commit is contained in:
Patrick Fic
2020-01-15 14:13:09 -08:00
parent fe5193a20b
commit 2e7c396339
24 changed files with 431 additions and 209 deletions

View File

@@ -9,15 +9,12 @@ const errorLink = onError(
console.log("networkError", networkError);
console.log("operation", operation);
console.log("forward", forward);
if (graphQLErrors) {
if (graphQLErrors[0]?.message.includes("JWTExpired") || networkError?.message.includes("JWTExpired")) {
//User access token has expired
console.log("graphQLErrors", graphQLErrors);
}
if (networkError) {
console.log(`[Network error]: ${networkError}`);
//props.history.push("/network-error");
if (networkError.message.includes("JWTExpired")) {
if (networkError?.message?.includes("JWTExpired")) {
console.log("Got to the error check.");
if (access_token && access_token !== "undefined") {
// Let's refresh token through async request

View File

@@ -22,3 +22,11 @@ export const QUERY_BODYSHOP = gql`
}
}
`;
export const QUERY_SHOP_ID = gql`
query QUERY_SHOP_ID {
bodyshops(where: { associations: { active: { _eq: true } } }) {
id
}
}
`;

View File

@@ -0,0 +1,22 @@
import { gql } from "apollo-boost";
export const GET_DOCUMENTS_BY_JOB = gql`
query GET_DOCUMENTS_BY_JOB($jobId: uuid!) {
documents(where: { jobid: { _eq: $jobId } }) {
id
url
thumb_url
name
}
}
`;
export const INSERT_NEW_DOCUMENT = gql`
mutation INSERT_NEW_DOCUMENT($docInput: [documents_insert_input!]!) {
insert_ducments(objects: $docInput) {
returning {
id
}
}
}
`;