Skip to content

Commit

Permalink
Merge branch 'main' into jime
Browse files Browse the repository at this point in the history
  • Loading branch information
Kojimena committed Oct 11, 2023
2 parents 3f89939 + 66cfbea commit c455d93
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const EditProfileEmpresa = () => {
const [correo, setCorreo] = useState("")
const [detalles, setDetalles] = useState("")
const [telefono, setTelefono] = useState("")
const [uploadedImage, setUploadedImage] = useState("")
const [uploadedImage, setUploadedImage] = useState("/images/pfp.svg")
const [updatedImage, setUpdatedImage] = useState("")
const [warning, setWarning] = useState(false)
const [error, setError] = useState("")
Expand Down Expand Up @@ -50,12 +50,14 @@ const EditProfileEmpresa = () => {
}
useEffect(() => {
if (api.data) {
const fotoUrl = API_URL + "/api/uploads/" + api.data.usuario.foto
const fotoUrl = (api.data.usuario.foto === "") ? "/images/pfp.svg" : (API_URL + "/api/uploads/" + api.data.usuario.foto)

console.log("Foto", fotoUrl)
setNombre(api.data.usuario.nombre)
setCorreo(api.data.usuario.correo)
setDetalles(api.data.usuario.detalles)
setTelefono(parseInt(api.data.usuario.telefono, 10))
setUploadedImage( fotoUrl)
setUploadedImage(fotoUrl)
}
}, [api.data])

Expand All @@ -76,7 +78,6 @@ const EditProfileEmpresa = () => {
detalles,
correo,
telefono: telefono.toString(),
foto: uploadedImage
}

// Con esto se pueden hacer las llamadas al status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const EditProfileEstudiante = () => {
const [universidad, setUniversidad] = useState("")
const [telefono, setTelefono] = useState("")
const [semestre, setSemestre] = useState(1)
const [uploadedImage, setUploadedImage] = useState("")
const [uploadedImage, setUploadedImage] = useState("/images/pfp.svg")
const [updatedImage, setUpdatedImage] = useState("")
const [warning, setWarning] = useState(false)
const [error, setError] = useState("")
Expand Down Expand Up @@ -63,7 +63,8 @@ const EditProfileEstudiante = () => {
useEffect(() => {
if (api.data) {
const { usuario } = api.data
const fotoUrl = API_URL + "/api/uploads/" + usuario.foto
// console.log("Foto from API", usuario.foto)
const fotoUrl = (api.data.usuario.foto === "") ? "/images/pfp.svg" : (API_URL + "/api/uploads/" + api.data.usuario.foto)
setNombre(usuario.nombre)
setApellido(usuario.apellido)
const date = new Date(usuario.nacimiento)
Expand Down Expand Up @@ -170,7 +171,6 @@ const EditProfileEstudiante = () => {
telefono,
semestre,
cv: "",
foto: uploadedImage,
correo: user.id_user,
}
)
Expand Down
5 changes: 3 additions & 2 deletions uniEmpleos/src/pages/PostulantesPage/PostulantesPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Popup from "../../components/Popup/Popup"
import { Header } from "../../components/Header/Header"
import { navigate } from "../../store"
import API_URL from "../../api"
import fotoPFP from "/images/pfp.svg"

const PostulantesPage = ({ id }) => {
const api = useApi()
Expand Down Expand Up @@ -35,7 +36,7 @@ const PostulantesPage = ({ id }) => {
const handleClickUsuario = (idUsuario) => {
navigate(`/publicprofile/${idUsuario}`)
}

console.log(response)
return (
<div className={style.mainContainer}>
<Header />
Expand All @@ -53,7 +54,7 @@ const PostulantesPage = ({ id }) => {
nombre={postulante.nombre}
apellido={postulante.apellido}
universidad={postulante.universidad}
pfp={`${API_URL}/api/uploads/${postulante.foto}`}
pfp={postulante.foto === "" ? fotoPFP : `${API_URL}/api/uploads/${postulante.foto}`}
onClick={() => handleClickUsuario(postulante.id_estudiante)}
/>
))
Expand Down

0 comments on commit c455d93

Please sign in to comment.