Skip to content

Commit

Permalink
fix bug (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
BSanchidrian authored Nov 6, 2024
1 parent 9919d0e commit e685701
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/app/solicitar-ayuda/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ export default function SolicitarAyuda() {
const router = useRouter();
const session = useSession();
const [formData, setFormData] = useState({
nombre: session.user.user_metadata.full_name || '',
nombre: session?.user?.user_metadata?.full_name || '',
ubicacion: '',
coordinates: null,
tiposAyuda: [],
numeroPersonas: '',
descripcion: '',
urgencia: 'alta',
situacionEspecial: '',
contacto: session.user.user_metadata.telefono || '',
contacto: session?.user?.user_metadata?.telefono || '',
consentimiento: false,
pueblo: '',
email: session.user.user_metadata.email || '',
email: session?.user?.user_metadata?.email || '',
});

const [status, setStatus] = useState({
Expand Down
6 changes: 3 additions & 3 deletions src/components/OfferHelp.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export default function OfferHelp({
const router = useRouter();

const [formData, setFormData] = useState({
nombre: data.name || session.user.user_metadata.full_name || '',
telefono: data.contact_info || session.user.user_metadata.telefono || '',
email: data.additional_info?.email || session.user.user_metadata.email || '',
nombre: data.name || session?.user?.user_metadata?.full_name || '',
telefono: data.contact_info || session?.user?.user_metadata?.telefono || '',
email: data.additional_info?.email || session?.user?.user_metadata?.email || '',
ubicacion: data.location || '',
tiposAyuda: data.help_type || [],
vehiculo: data.resources?.vehicle || '',
Expand Down

0 comments on commit e685701

Please sign in to comment.