Skip to content

Commit

Permalink
Merge pull request #139 from pedrolivaresanchez/fix/error-solicitar-a…
Browse files Browse the repository at this point in the history
…yuda

fix: error en solicitar ayuda con usuario correo
  • Loading branch information
Troleomotor10 authored Nov 7, 2024
2 parents da2bd2c + 56352ca commit 7f93744
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/solicitar-ayuda/_components/Form/FormContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function FormContainer() {
const session = useSession();

const [formData, setFormData] = useState<FormData>({
nombre: session?.user?.user_metadata?.full_name.split(" ")[0]|| '',
nombre: session?.user?.user_metadata?.full_name || session?.user?.user_metadata?.nombre || ''.split(' ')[0],
ubicacion: '',
coordinates: null,
tiposDeAyuda: new Map(TIPOS_DE_AYUDA.map(({ id }) => [id, false])),
Expand Down Expand Up @@ -91,7 +91,7 @@ export function FormContainer() {
try {
const helpRequestData: Database['public']['Tables']['help_requests']['Insert'] = {
type: 'necesita',
name: formData.nombre.split(" ")[0],
name: formData.nombre.split(' ')[0],
location: formData.ubicacion,
latitude: formData.coordinates ? parseFloat(formData.coordinates.lat) : null,
longitude: formData.coordinates ? parseFloat(formData.coordinates.lng) : null,
Expand Down

0 comments on commit 7f93744

Please sign in to comment.