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:
Jérémy M
2023-07-20 21:23:35 +02:00
committed by GitHub
parent 663c4d5c3f
commit 872ec9e6bb
58 changed files with 622 additions and 652 deletions

View File

@ -5,7 +5,7 @@ import { FieldContext } from '@/ui/editable-field/states/FieldContext';
import { IconMap } from '@/ui/icon';
import { InplaceInputText } from '@/ui/inplace-input/components/InplaceInputText';
import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope';
import { Company, useUpdateCompanyMutation } from '~/generated/graphql';
import { Company, useUpdateOneCompanyMutation } from '~/generated/graphql';
type OwnProps = {
company: Pick<Company, 'id' | 'address'>;
@ -14,7 +14,7 @@ type OwnProps = {
export function CompanyEditableFieldAddress({ company }: OwnProps) {
const [internalValue, setInternalValue] = useState(company.address);
const [updateCompany] = useUpdateCompanyMutation();
const [updateCompany] = useUpdateOneCompanyMutation();
useEffect(() => {
setInternalValue(company.address);
@ -27,8 +27,12 @@ export function CompanyEditableFieldAddress({ company }: OwnProps) {
async function handleSubmit() {
await updateCompany({
variables: {
id: company.id,
address: internalValue ?? '',
where: {
id: company.id,
},
data: {
address: internalValue ?? '',
},
},
});
}

View File

@ -29,9 +29,7 @@ export function useColorScheme() {
data: {
settings: {
update: {
colorScheme: {
set: value,
},
colorScheme: value,
},
},
},