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:
@ -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 ?? '',
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@ -29,9 +29,7 @@ export function useColorScheme() {
|
||||
data: {
|
||||
settings: {
|
||||
update: {
|
||||
colorScheme: {
|
||||
set: value,
|
||||
},
|
||||
colorScheme: value,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user