feat: disable atomic operation on nestjs graphql models (#751)
* feat: no atomic * feat: update front not atomic operations * feat: optional fields for person model & use proper gql type * Fix bug display name * Fix bug update user * Fixed bug avatar URL * Fixed display name on people cell * Fix lint * Fixed storybook display name * Fix storybook requests --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
import { getOperationName } from '@apollo/client/utilities';
|
||||
import { useTheme } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import { GET_COMPANIES } from '@/companies/queries';
|
||||
import { CompanyTable } from '@/companies/table/components/CompanyTable';
|
||||
@ -12,10 +11,7 @@ import { WithTopBarContainer } from '@/ui/layout/components/WithTopBarContainer'
|
||||
import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope';
|
||||
import { EntityTableActionBar } from '@/ui/table/action-bar/components/EntityTableActionBar';
|
||||
import { TableContext } from '@/ui/table/states/TableContext';
|
||||
import {
|
||||
InsertCompanyMutationVariables,
|
||||
useInsertCompanyMutation,
|
||||
} from '~/generated/graphql';
|
||||
import { useInsertOneCompanyMutation } from '~/generated/graphql';
|
||||
|
||||
import { SEARCH_COMPANY_QUERY } from '../../modules/search/queries/search';
|
||||
|
||||
@ -25,20 +21,17 @@ const StyledTableContainer = styled.div`
|
||||
`;
|
||||
|
||||
export function Companies() {
|
||||
const [insertCompany] = useInsertCompanyMutation();
|
||||
const [insertCompany] = useInsertOneCompanyMutation();
|
||||
|
||||
async function handleAddButtonClick() {
|
||||
const newCompany: InsertCompanyMutationVariables = {
|
||||
id: uuidv4(),
|
||||
name: '',
|
||||
domainName: '',
|
||||
employees: null,
|
||||
address: '',
|
||||
createdAt: new Date().toISOString(),
|
||||
};
|
||||
|
||||
await insertCompany({
|
||||
variables: newCompany,
|
||||
variables: {
|
||||
data: {
|
||||
name: '',
|
||||
domainName: '',
|
||||
address: '',
|
||||
},
|
||||
},
|
||||
refetchQueries: [
|
||||
getOperationName(GET_COMPANIES) ?? '',
|
||||
getOperationName(SEARCH_COMPANY_QUERY) ?? '',
|
||||
|
||||
Reference in New Issue
Block a user