Skip to content

Commit

Permalink
PLEASE NOW
Browse files Browse the repository at this point in the history
  • Loading branch information
pulgueta committed Jul 24, 2023
1 parent 24b3df8 commit a47749e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/checkout/PaymentInformation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const PaymentInformation: FC = (): JSX.Element => {
console.log('Form data:', formData);
if (formData.cardNumber.length >= 16 && formData.name.length >= 6 && formData.cvv.length >= 3) {
try {
await addOrder(cart, total, formData.cardNumber, userInformation.uid)
await addOrder(cart, total, formData.cardNumber, userInformation!.uid)
navigate('/success')
} catch (e) {
throw e
Expand Down
4 changes: 2 additions & 2 deletions src/components/user/AddAddressModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const AddAddressModal: FC = (): JSX.Element => {
state: '',
city: '',
colony: '',
email: userInformation.email,
email: userInformation!.email,
});


Expand Down Expand Up @@ -105,7 +105,7 @@ const AddAddressModal: FC = (): JSX.Element => {
const onSubmit: SubmitHandler<Shipping> = async (values) => {
try {
console.log(values);
await addAddress(values, userInformation.uid)
await addAddress(values, userInformation!.uid)

toast({
status: 'success',
Expand Down
2 changes: 1 addition & 1 deletion src/components/user/UserUpdateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const UserUpdateModal: FC = (): JSX.Element => {

const onUpdateValues: SubmitHandler<PersonalDataProps> = async (values) => {
try {
await updateInformation(values, userInformation.uid)
await updateInformation(values, userInformation!.uid)
toast({
title: 'Actualización de datos',
description: 'Se han actualizado tus datos',
Expand Down
4 changes: 2 additions & 2 deletions src/pages/user/address/Addresses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const Addresses: FC = (): JSX.Element => {
<AddAddressModal />

{
userInformation.address === null
userInformation!.address === null
? <Text>No tienes direcciones actualmente</Text>
: <Stack spacing={6}>
{userInformation.address!.map((address: Shipping) => (
{userInformation!.address!.map((address: Shipping) => (
<AddressCard {...address} />
))}
</Stack>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/user/security/Security.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Security: FC = (): JSX.Element => {
<Stack spacing={4} w='full'>
<FormControl>
<FormLabel>Correo electrónico</FormLabel>
<Input value={userInformation.email} readOnly />
<Input value={userInformation!.email} readOnly />
</FormControl>
<FormControl>
<FormLabel>Contraseña</FormLabel>
Expand Down

0 comments on commit a47749e

Please sign in to comment.