mirror of
				https://github.com/xfarrow/blink
				synced 2025-06-27 09:03:02 +02:00 
			
		
		
		
	Add qualification
This commit is contained in:
		| @@ -25,7 +25,7 @@ const bcrypt = require('bcrypt'); | |||||||
|  * @param {*} placeOfLiving |  * @param {*} placeOfLiving | ||||||
|  * @returns |  * @returns | ||||||
|  */ |  */ | ||||||
| function createPerson (email, password, displayName, dateOfBirth, available, enabled, placeOfLiving, aboutMe) { | function createPerson (email, password, displayName, dateOfBirth, available, enabled, placeOfLiving, aboutMe, qualification) { | ||||||
|   const person = { |   const person = { | ||||||
|     email: email.toLowerCase(), |     email: email.toLowerCase(), | ||||||
|     password, |     password, | ||||||
| @@ -34,7 +34,8 @@ function createPerson (email, password, displayName, dateOfBirth, available, ena | |||||||
|     available, |     available, | ||||||
|     enabled, |     enabled, | ||||||
|     place_of_living: placeOfLiving, |     place_of_living: placeOfLiving, | ||||||
|     about_me: aboutMe |     about_me: aboutMe, | ||||||
|  |     qualification | ||||||
|   }; |   }; | ||||||
|   return person; |   return person; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -58,7 +58,8 @@ async function registerPerson (req, res) { | |||||||
|       req.body.available, |       req.body.available, | ||||||
|       false, |       false, | ||||||
|       req.body.place_of_living, |       req.body.place_of_living, | ||||||
|       req.body.about_me); |       req.body.about_me, | ||||||
|  |       req.body.qualification); | ||||||
|     await personModel.registerPerson(personToInsert, activationLink); |     await personModel.registerPerson(personToInsert, activationLink); | ||||||
|     return res.status(200).json({ activationLink }); |     return res.status(200).json({ activationLink }); | ||||||
|   } catch (error) { |   } catch (error) { | ||||||
| @@ -180,6 +181,10 @@ async function updatePerson (req, res) { | |||||||
|     updatePerson.about_me = req.body.about_me; |     updatePerson.about_me = req.body.about_me; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   if(req.body.qualification) { | ||||||
|  |     updatePerson.qualification = req.body.qualification; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   // If we are tying to change password, the old password must be provided |   // If we are tying to change password, the old password must be provided | ||||||
|   if (req.body.old_password || req.body.new_password) { |   if (req.body.old_password || req.body.new_password) { | ||||||
|     if(!req.body.old_password){ |     if(!req.body.old_password){ | ||||||
|   | |||||||
| @@ -5,14 +5,15 @@ | |||||||
| CREATE TABLE IF NOT EXISTS public."Person" | CREATE TABLE IF NOT EXISTS public."Person" | ||||||
| ( | ( | ||||||
|     id SERIAL PRIMARY KEY, |     id SERIAL PRIMARY KEY, | ||||||
|     email character varying(128) NOT NULL UNIQUE, |     email character varying(128) NOT NULL UNIQUE, -- Primary e-mail | ||||||
|     password character varying(128) NOT NULL, |     password character varying(128) NOT NULL, | ||||||
|     display_name character varying(128) NOT NULL, |     display_name character varying(128) NOT NULL, | ||||||
|     date_of_birth date, |     date_of_birth date, | ||||||
|     available boolean, |     available boolean, -- Whether this person is available to be hired | ||||||
|     enabled boolean NOT NULL DEFAULT false, |     enabled boolean NOT NULL DEFAULT false, -- Whether this profile is active | ||||||
|     place_of_living character varying(128), |     place_of_living character varying(128), | ||||||
|     about_me character varying(4096) |     about_me character varying(4096), | ||||||
|  |     qualification character varying(64) | ||||||
| ) | ) | ||||||
|  |  | ||||||
| TABLESPACE pg_default; | TABLESPACE pg_default; | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ | |||||||
|         <header> |         <header> | ||||||
|             <img src="../content/profile-picture-example.jpg" alt="Profile Picture" class="profile-picture"> |             <img src="../content/profile-picture-example.jpg" alt="Profile Picture" class="profile-picture"> | ||||||
|             <h1 id="displayName">Name Surname</h1> |             <h1 id="displayName">Name Surname</h1> | ||||||
|             <p id="profession">Title</p> |             <p id="qualification">Title</p> | ||||||
|         </header> |         </header> | ||||||
|         <section> |         <section> | ||||||
|             <h2>About Me</h2> |             <h2>About Me</h2> | ||||||
| @@ -80,7 +80,7 @@ | |||||||
|  |  | ||||||
|             const data = await response.json(); |             const data = await response.json(); | ||||||
|             if (response.ok){ |             if (response.ok){ | ||||||
|                 populateFields(data.display_name, data.email, data.about_me); |                 populateFields(data.display_name, data.email, data.about_me, data.qualification); | ||||||
|                 document.body.style.display = 'block'; // Show page |                 document.body.style.display = 'block'; // Show page | ||||||
|             } |             } | ||||||
|             else if (response.status == 401){ |             else if (response.status == 401){ | ||||||
| @@ -91,11 +91,12 @@ | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         function populateFields (displayName, email, aboutMe) { |         function populateFields (displayName, email, aboutMe, qualification) { | ||||||
|             document.getElementById('displayName').textContent = displayName; |             document.getElementById('displayName').textContent = displayName; | ||||||
|             document.title = `${displayName} - Blink` |             document.title = `${displayName} - Blink` | ||||||
|             document.getElementById('email').textContent = email; |             document.getElementById('email').textContent = email; | ||||||
|             document.getElementById('aboutMe').textContent = aboutMe; |             document.getElementById('aboutMe').textContent = aboutMe; | ||||||
|  |             document.getElementById('qualification').textContent = qualification; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         function editProfile () { |         function editProfile () { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user