Skip to content

Commit

Permalink
language bug fixed at all places
Browse files Browse the repository at this point in the history
  • Loading branch information
rathorevaibhav committed Oct 5, 2020
1 parent 8eb5617 commit ec8f863
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/containers/Form/FormLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,19 @@ export const FormLayout: React.SFC<FormLayoutProps> = ({
let toastMessage: {} | null | undefined;

// get the organization for current user and have languages option set to that.

const capitalListItemName = listItemName[0].toUpperCase() + listItemName.slice(1);

const itemId = match.params.id ? match.params.id : false;

const organization = useQuery(USER_LANGUAGES, {
onCompleted: (data: any) => {
setLanguageId(data.currentUser.user.organization.defaultLanguage.id);
if (!itemId) {
setLanguageId(data.currentUser.user.organization.defaultLanguage.id);
}
},
});

const capitalListItemName = listItemName[0].toUpperCase() + listItemName.slice(1);

const itemId = match.params.id ? match.params.id : false;
const { loading, error } = useQuery(getItemQuery, {
variables: { id: itemId },
skip: !itemId,
Expand Down
4 changes: 4 additions & 0 deletions src/graphql/mutations/Automation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export const UPDATE_AUTOMATION = gql`
flow {
id
name
language {
id
label
}
}
errors {
key
Expand Down
8 changes: 8 additions & 0 deletions src/graphql/mutations/Contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export const CREATE_CONTACT = gql`
id
name
phone
language {
id
label
}
}
}
}
Expand All @@ -30,6 +34,10 @@ export const UPDATE_CONTACT = gql`
id
name
phone
language {
id
label
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/graphql/mutations/Tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export const UPDATE_TAG = gql`
label
description
colorCode
language {
id
label
}
parent {
id
}
Expand Down
4 changes: 4 additions & 0 deletions src/graphql/mutations/Template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export const UPDATE_TEMPLATE = gql`
id
label
body
language {
id
label
}
}
}
}
Expand Down

0 comments on commit ec8f863

Please sign in to comment.