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
|
||||
* @returns
|
||||
*/
|
||||
function createPerson (email, password, displayName, dateOfBirth, available, enabled, placeOfLiving, aboutMe) {
|
||||
function createPerson (email, password, displayName, dateOfBirth, available, enabled, placeOfLiving, aboutMe, qualification) {
|
||||
const person = {
|
||||
email: email.toLowerCase(),
|
||||
password,
|
||||
@ -34,7 +34,8 @@ function createPerson (email, password, displayName, dateOfBirth, available, ena
|
||||
available,
|
||||
enabled,
|
||||
place_of_living: placeOfLiving,
|
||||
about_me: aboutMe
|
||||
about_me: aboutMe,
|
||||
qualification
|
||||
};
|
||||
return person;
|
||||
}
|
||||
|
@ -58,7 +58,8 @@ async function registerPerson (req, res) {
|
||||
req.body.available,
|
||||
false,
|
||||
req.body.place_of_living,
|
||||
req.body.about_me);
|
||||
req.body.about_me,
|
||||
req.body.qualification);
|
||||
await personModel.registerPerson(personToInsert, activationLink);
|
||||
return res.status(200).json({ activationLink });
|
||||
} catch (error) {
|
||||
@ -180,6 +181,10 @@ async function updatePerson (req, res) {
|
||||
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 (req.body.old_password || req.body.new_password) {
|
||||
if(!req.body.old_password){
|
||||
|
@ -5,14 +5,15 @@
|
||||
CREATE TABLE IF NOT EXISTS public."Person"
|
||||
(
|
||||
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,
|
||||
display_name character varying(128) NOT NULL,
|
||||
date_of_birth date,
|
||||
available boolean,
|
||||
enabled boolean NOT NULL DEFAULT false,
|
||||
available boolean, -- Whether this person is available to be hired
|
||||
enabled boolean NOT NULL DEFAULT false, -- Whether this profile is active
|
||||
place_of_living character varying(128),
|
||||
about_me character varying(4096)
|
||||
about_me character varying(4096),
|
||||
qualification character varying(64)
|
||||
)
|
||||
|
||||
TABLESPACE pg_default;
|
||||
|
Reference in New Issue
Block a user