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:
@ -8,7 +8,7 @@ import {
|
||||
Company,
|
||||
User,
|
||||
useSearchUserQuery,
|
||||
useUpdateCompanyMutation,
|
||||
useUpdateOneCompanyMutation,
|
||||
} from '~/generated/graphql';
|
||||
|
||||
export type OwnProps = {
|
||||
@ -31,7 +31,7 @@ export function CompanyAccountOwnerPicker({
|
||||
const [searchFilter] = useRecoilScopedState(
|
||||
relationPickerSearchFilterScopedState,
|
||||
);
|
||||
const [updateCompany] = useUpdateCompanyMutation();
|
||||
const [updateCompany] = useUpdateOneCompanyMutation();
|
||||
|
||||
const companies = useFilteredSearchEntityQuery({
|
||||
queryHook: useSearchUserQuery,
|
||||
@ -51,8 +51,10 @@ export function CompanyAccountOwnerPicker({
|
||||
async function handleEntitySelected(selectedUser: UserForSelect) {
|
||||
await updateCompany({
|
||||
variables: {
|
||||
...company,
|
||||
accountOwnerId: selectedUser.id,
|
||||
where: { id: company.id },
|
||||
data: {
|
||||
accountOwner: { connect: { id: selectedUser.id } },
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user