Skip to content

Commit

Permalink
Merge pull request #55 from Bostonhacks/sponsor-pictures
Browse files Browse the repository at this point in the history
added resume url
  • Loading branch information
danielyu12 committed Sep 26, 2023
2 parents d400c23 + 4f37c4d commit 0baa0b9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/Application.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useNavigate } from 'react-router-dom';
import { auth, db, storage } from '../firebase/firebase-config';
import { useAuthState } from 'react-firebase-hooks/auth';
import { doc, updateDoc } from 'firebase/firestore';
import { ref, uploadBytes } from 'firebase/storage';
import { ref, uploadBytes, getDownloadURL } from 'firebase/storage';

import { useForm, Controller } from 'react-hook-form';
import Select from 'react-select';
Expand Down Expand Up @@ -145,8 +145,12 @@ const Application = ({ applicationId }) => {

if (resume != null) {
const resumeRef = ref(storage, `${applicationId}`);
const resumeURL = await getDownloadURL(resumeRef);
console.log(resumeURL);
uploadBytes(resumeRef, resume).then(() => {
navigate('/login');
updateDoc(userDoc, {
resumeURL: resumeURL,
}).then(navigate('/login'));
});
} else {
alert('please upload a resume');
Expand Down

0 comments on commit 0baa0b9

Please sign in to comment.