mirror of
https://github.com/hazemKrimi/crimson-quirks-ui.git
synced 2026-05-02 02:30:29 +00:00
Update graphql types and mutations
This commit is contained in:
@@ -85,12 +85,15 @@ const AdditionalInfo = () => {
|
||||
}) =>
|
||||
updateUserInfo({
|
||||
variables: {
|
||||
id: currentUser?.id!,
|
||||
email: currentUser?.email!,
|
||||
firstName,
|
||||
lastName,
|
||||
phone: { prefix, number },
|
||||
address: { place, city, country, zip },
|
||||
user: {
|
||||
id: currentUser?.id!,
|
||||
email: currentUser?.email!,
|
||||
firstName,
|
||||
lastName,
|
||||
phone: { prefix, number },
|
||||
address: { place, city, country, zip },
|
||||
role: currentUser?.role!,
|
||||
},
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -169,7 +169,7 @@ const CreateUser = () => {
|
||||
}),
|
||||
onSubmit: ({ password }) => {
|
||||
setNewUser({ ...newUser, password });
|
||||
createUser({ variables: { ...newUser } });
|
||||
createUser({ variables: { user: { ...newUser } } });
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -108,12 +108,15 @@ const Settings = () => {
|
||||
}) =>
|
||||
updateUserInfo({
|
||||
variables: {
|
||||
id: currentUser?.id!,
|
||||
email: currentUser?.email!,
|
||||
firstName,
|
||||
lastName,
|
||||
phone: { prefix, number },
|
||||
address: { place, city, country, zip },
|
||||
user: {
|
||||
id: currentUser?.id!,
|
||||
email: currentUser?.email!,
|
||||
firstName,
|
||||
lastName,
|
||||
phone: { prefix, number },
|
||||
address: { place, city, country, zip },
|
||||
role: currentUser?.role!,
|
||||
},
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
GetCountryCodesQueryVariables,
|
||||
GetUserByIdQuery,
|
||||
GetUserByIdQueryVariables,
|
||||
UserResponseModel,
|
||||
UserOutput,
|
||||
} from '../../graphql/types';
|
||||
import {
|
||||
GET_COUNTRY_CODES,
|
||||
@@ -37,7 +37,7 @@ import {
|
||||
const UserSettings = () => {
|
||||
const history = useHistory();
|
||||
const role = useReactiveVar(roleVar);
|
||||
const [userToEdit, setUserToEdit] = useState<UserResponseModel>();
|
||||
const [userToEdit, setUserToEdit] = useState<UserOutput>();
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const { data: countryCodes, loading: countryCodesLoading } = useQuery<
|
||||
GetCountryCodesQuery,
|
||||
@@ -119,12 +119,15 @@ const UserSettings = () => {
|
||||
}) =>
|
||||
updateUserInfo({
|
||||
variables: {
|
||||
id: userToEdit?.id!,
|
||||
email: userToEdit?.email!,
|
||||
firstName,
|
||||
lastName,
|
||||
phone: { prefix, number },
|
||||
address: { place, city, country, zip },
|
||||
user: {
|
||||
id: userToEdit?.id!,
|
||||
email: userToEdit?.email!,
|
||||
firstName,
|
||||
lastName,
|
||||
phone: { prefix, number },
|
||||
address: { place, city, country, zip },
|
||||
role: userToEdit?.role!,
|
||||
},
|
||||
},
|
||||
}),
|
||||
enableReinitialize: true,
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
DeleteUserMutationVariables,
|
||||
GetAllUsersQuery,
|
||||
GetAllUsersQueryVariables,
|
||||
UserResponseModel,
|
||||
UserOutput,
|
||||
} from '../../graphql/types';
|
||||
import { GET_ALL_USERS } from '../../graphql/admin.api';
|
||||
import { DELETE_USER } from '../../graphql/auth.api';
|
||||
@@ -29,8 +29,8 @@ const Users = () => {
|
||||
const role = useReactiveVar(roleVar);
|
||||
const history = useHistory();
|
||||
const location = useLocation();
|
||||
const [users, setUsers] = useState<Array<UserResponseModel>>();
|
||||
const [userToDelete, setUserToDelete] = useState<UserResponseModel>();
|
||||
const [users, setUsers] = useState<Array<UserOutput>>();
|
||||
const [userToDelete, setUserToDelete] = useState<UserOutput>();
|
||||
const [error, setError] = useState<string>('');
|
||||
const [deleteAccountModal, setDeleteAccountModal] = useState<boolean>(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user