mirror of
https://github.com/xfarrow/blink
synced 2025-06-27 09:03:02 +02:00
Create experience endpoint (beta)
This commit is contained in:
20
backend/apis/BlinkApiCollection/ActivatePerson.bru
Normal file
20
backend/apis/BlinkApiCollection/ActivatePerson.bru
Normal file
@ -0,0 +1,20 @@
|
||||
meta {
|
||||
name: ActivatePerson
|
||||
type: http
|
||||
seq: 27
|
||||
}
|
||||
|
||||
get {
|
||||
url: http://localhost:3000/api/people/me/activation?q=3ac9c204de1676b54163ed8015c7af00
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
params:query {
|
||||
q: 3ac9c204de1676b54163ed8015c7af00
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
22
backend/apis/BlinkApiCollection/AddOrganizationAdmin.bru
Normal file
22
backend/apis/BlinkApiCollection/AddOrganizationAdmin.bru
Normal file
@ -0,0 +1,22 @@
|
||||
meta {
|
||||
name: AddOrganizationAdmin
|
||||
type: http
|
||||
seq: 13
|
||||
}
|
||||
|
||||
post {
|
||||
url: http://localhost:3000/api/organizations/1/admins
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"personId" : "2"
|
||||
}
|
||||
}
|
17
backend/apis/BlinkApiCollection/ChangeApplicationStatus.bru
Normal file
17
backend/apis/BlinkApiCollection/ChangeApplicationStatus.bru
Normal file
@ -0,0 +1,17 @@
|
||||
meta {
|
||||
name: ChangeApplicationStatus
|
||||
type: http
|
||||
seq: 8
|
||||
}
|
||||
|
||||
patch {
|
||||
url: http://localhost:3000/api/organizations/joboffers/applications/5
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"status": "ACCEPTED"
|
||||
}
|
||||
}
|
11
backend/apis/BlinkApiCollection/CreateApplication.bru
Normal file
11
backend/apis/BlinkApiCollection/CreateApplication.bru
Normal file
@ -0,0 +1,11 @@
|
||||
meta {
|
||||
name: CreateApplication
|
||||
type: http
|
||||
seq: 11
|
||||
}
|
||||
|
||||
post {
|
||||
url: http://localhost:3000/api/organizations/joboffers/1/applications
|
||||
body: none
|
||||
auth: none
|
||||
}
|
11
backend/apis/BlinkApiCollection/CreateExperience.bru
Normal file
11
backend/apis/BlinkApiCollection/CreateExperience.bru
Normal file
@ -0,0 +1,11 @@
|
||||
meta {
|
||||
name: CreateExperience
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: http://localhost:3000/api/experiences
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
30
backend/apis/BlinkApiCollection/CreateJobOffer.bru
Normal file
30
backend/apis/BlinkApiCollection/CreateJobOffer.bru
Normal file
@ -0,0 +1,30 @@
|
||||
meta {
|
||||
name: CreateJobOffer
|
||||
type: http
|
||||
seq: 7
|
||||
}
|
||||
|
||||
post {
|
||||
url: http://localhost:3000/api/organizations/1/joboffers
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"title" : "NodeJS developer",
|
||||
"description" : "We are looking for NodeJS developers which can help us build Blink",
|
||||
"salaryFrequency": "YEARLY",
|
||||
"salary": [20000, 23000],
|
||||
"salaryCurrency": "EUR",
|
||||
"location" : "Rome",
|
||||
"remote": "PARTIALLY",
|
||||
"contractType": "PART-TIME",
|
||||
"tags" : ["javascript"]
|
||||
}
|
||||
}
|
24
backend/apis/BlinkApiCollection/CreateOrganization.bru
Normal file
24
backend/apis/BlinkApiCollection/CreateOrganization.bru
Normal file
@ -0,0 +1,24 @@
|
||||
meta {
|
||||
name: CreateOrganization
|
||||
type: http
|
||||
seq: 17
|
||||
}
|
||||
|
||||
post {
|
||||
url: http://localhost:3000/api/organizations
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"name" : "Blink Inc.",
|
||||
"location" : "Napoli, Italy",
|
||||
"description" : "Blink is a privacy-respecting business-oriented social media platform focused on fostering connections between businesses and individuals, propelling careers and sparking innovation in the professional world."
|
||||
}
|
||||
}
|
17
backend/apis/BlinkApiCollection/DeleteApplication.bru
Normal file
17
backend/apis/BlinkApiCollection/DeleteApplication.bru
Normal file
@ -0,0 +1,17 @@
|
||||
meta {
|
||||
name: DeleteApplication
|
||||
type: http
|
||||
seq: 10
|
||||
}
|
||||
|
||||
delete {
|
||||
url: http://localhost:3000/api/organizations/joboffers/applications/6
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"jobApplicationId": 1
|
||||
}
|
||||
}
|
11
backend/apis/BlinkApiCollection/DeleteContactInfo.bru
Normal file
11
backend/apis/BlinkApiCollection/DeleteContactInfo.bru
Normal file
@ -0,0 +1,11 @@
|
||||
meta {
|
||||
name: DeleteContactInfo
|
||||
type: http
|
||||
seq: 19
|
||||
}
|
||||
|
||||
delete {
|
||||
url: http://localhost:3000/api/people/contactinfos/2
|
||||
body: none
|
||||
auth: none
|
||||
}
|
15
backend/apis/BlinkApiCollection/DeleteJobOffer.bru
Normal file
15
backend/apis/BlinkApiCollection/DeleteJobOffer.bru
Normal file
@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: DeleteJobOffer
|
||||
type: http
|
||||
seq: 6
|
||||
}
|
||||
|
||||
delete {
|
||||
url: http://localhost:3000/api/organizations/joboffers/3
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
15
backend/apis/BlinkApiCollection/DeleteOrganization.bru
Normal file
15
backend/apis/BlinkApiCollection/DeleteOrganization.bru
Normal file
@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: DeleteOrganization
|
||||
type: http
|
||||
seq: 14
|
||||
}
|
||||
|
||||
delete {
|
||||
url: http://localhost:3000/api/organizations/1
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
15
backend/apis/BlinkApiCollection/DeletePerson.bru
Normal file
15
backend/apis/BlinkApiCollection/DeletePerson.bru
Normal file
@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: DeletePerson
|
||||
type: http
|
||||
seq: 21
|
||||
}
|
||||
|
||||
delete {
|
||||
url: http://localhost:3000/api/people/me
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
meta {
|
||||
name: FilterOrganizationByPrefix
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: http://localhost:3000/api/organizations/filter
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"name" : "bli"
|
||||
}
|
||||
}
|
11
backend/apis/BlinkApiCollection/GetApplicantsByJobOffer.bru
Normal file
11
backend/apis/BlinkApiCollection/GetApplicantsByJobOffer.bru
Normal file
@ -0,0 +1,11 @@
|
||||
meta {
|
||||
name: GetApplicantsByJobOffer
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: http://localhost:3000/api/organizations/joboffers/1/applications
|
||||
body: json
|
||||
auth: none
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
meta {
|
||||
name: GetApplicantsByOrganization
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
get {
|
||||
url: http://localhost:3000/api/organizations/1/joboffers/applications
|
||||
body: json
|
||||
auth: none
|
||||
}
|
11
backend/apis/BlinkApiCollection/GetContactInfosByPerson.bru
Normal file
11
backend/apis/BlinkApiCollection/GetContactInfosByPerson.bru
Normal file
@ -0,0 +1,11 @@
|
||||
meta {
|
||||
name: GetContactInfosByPerson
|
||||
type: http
|
||||
seq: 18
|
||||
}
|
||||
|
||||
get {
|
||||
url: http://localhost:3000/api/people/1/contactinfos
|
||||
body: none
|
||||
auth: none
|
||||
}
|
15
backend/apis/BlinkApiCollection/GetJobOffers.bru
Normal file
15
backend/apis/BlinkApiCollection/GetJobOffers.bru
Normal file
@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: GetJobOffers
|
||||
type: http
|
||||
seq: 5
|
||||
}
|
||||
|
||||
get {
|
||||
url: http://localhost:3000/api/organizations/1/joboffers/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
11
backend/apis/BlinkApiCollection/GetMyApplications.bru
Normal file
11
backend/apis/BlinkApiCollection/GetMyApplications.bru
Normal file
@ -0,0 +1,11 @@
|
||||
meta {
|
||||
name: GetMyApplications
|
||||
type: http
|
||||
seq: 9
|
||||
}
|
||||
|
||||
get {
|
||||
url: http://localhost:3000/api/organizations/joboffers/applications/mine
|
||||
body: none
|
||||
auth: none
|
||||
}
|
15
backend/apis/BlinkApiCollection/GetMyself.bru
Normal file
15
backend/apis/BlinkApiCollection/GetMyself.bru
Normal file
@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: GetMyself
|
||||
type: http
|
||||
seq: 22
|
||||
}
|
||||
|
||||
get {
|
||||
url: http://localhost:3000/api/people/me
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
15
backend/apis/BlinkApiCollection/GetOrganization.bru
Normal file
15
backend/apis/BlinkApiCollection/GetOrganization.bru
Normal file
@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: GetOrganization
|
||||
type: http
|
||||
seq: 16
|
||||
}
|
||||
|
||||
get {
|
||||
url: http://localhost:3000/api/organizations/1
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
15
backend/apis/BlinkApiCollection/GetPerson.bru
Normal file
15
backend/apis/BlinkApiCollection/GetPerson.bru
Normal file
@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: GetPerson
|
||||
type: http
|
||||
seq: 23
|
||||
}
|
||||
|
||||
get {
|
||||
url: http://localhost:3000/api/people/1/details
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
18
backend/apis/BlinkApiCollection/InsertContactInfo.bru
Normal file
18
backend/apis/BlinkApiCollection/InsertContactInfo.bru
Normal file
@ -0,0 +1,18 @@
|
||||
meta {
|
||||
name: InsertContactInfo
|
||||
type: http
|
||||
seq: 20
|
||||
}
|
||||
|
||||
post {
|
||||
url: http://localhost:3000/api/people/myself/contactinfos
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"content": "www.john.com",
|
||||
"info_type": "WEBSITE"
|
||||
}
|
||||
}
|
23
backend/apis/BlinkApiCollection/Login.bru
Normal file
23
backend/apis/BlinkApiCollection/Login.bru
Normal file
@ -0,0 +1,23 @@
|
||||
meta {
|
||||
name: Login
|
||||
type: http
|
||||
seq: 28
|
||||
}
|
||||
|
||||
post {
|
||||
url: http://localhost:3000/api/people/me/token
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"email": "john@mail.org",
|
||||
"password": "password"
|
||||
}
|
||||
}
|
26
backend/apis/BlinkApiCollection/Register.bru
Normal file
26
backend/apis/BlinkApiCollection/Register.bru
Normal file
@ -0,0 +1,26 @@
|
||||
meta {
|
||||
name: Register
|
||||
type: http
|
||||
seq: 29
|
||||
}
|
||||
|
||||
post {
|
||||
url: http://localhost:3000/api/people
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"email" : "john@mail.org",
|
||||
"password" : "password",
|
||||
"displayName" : "John Doe",
|
||||
"aboutMe" : "I am a passionate software engineer",
|
||||
"qualification" : "Software Engineer"
|
||||
}
|
||||
}
|
16
backend/apis/BlinkApiCollection/RemoveOrganizationAdmin.bru
Normal file
16
backend/apis/BlinkApiCollection/RemoveOrganizationAdmin.bru
Normal file
@ -0,0 +1,16 @@
|
||||
meta {
|
||||
name: RemoveOrganizationAdmin
|
||||
type: http
|
||||
seq: 12
|
||||
}
|
||||
|
||||
delete {
|
||||
url: http://localhost:3000/api/organizations/1/admins/me
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
22
backend/apis/BlinkApiCollection/RequestNewPassword.bru
Normal file
22
backend/apis/BlinkApiCollection/RequestNewPassword.bru
Normal file
@ -0,0 +1,22 @@
|
||||
meta {
|
||||
name: RequestNewPassword
|
||||
type: http
|
||||
seq: 25
|
||||
}
|
||||
|
||||
post {
|
||||
url: http://localhost:3000/api/resetpassword/request
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"email": "john@mail.org"
|
||||
}
|
||||
}
|
23
backend/apis/BlinkApiCollection/ResetNewPassword.bru
Normal file
23
backend/apis/BlinkApiCollection/ResetNewPassword.bru
Normal file
@ -0,0 +1,23 @@
|
||||
meta {
|
||||
name: ResetNewPassword
|
||||
type: http
|
||||
seq: 24
|
||||
}
|
||||
|
||||
post {
|
||||
url: http://localhost:3000/api/resetpassword/reset
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"secret": "360837853e2d3cf799c709b44720b4e3",
|
||||
"password": "password"
|
||||
}
|
||||
}
|
24
backend/apis/BlinkApiCollection/UpdateOrganization.bru
Normal file
24
backend/apis/BlinkApiCollection/UpdateOrganization.bru
Normal file
@ -0,0 +1,24 @@
|
||||
meta {
|
||||
name: UpdateOrganization
|
||||
type: http
|
||||
seq: 15
|
||||
}
|
||||
|
||||
patch {
|
||||
url: http://localhost:3000/api/organizations/1
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"name": "Blink Inc.",
|
||||
"location": "Naples (Campania), Italy",
|
||||
"description": "Blink is a privacy-respecting business-oriented social media platform focused on fostering connections between businesses and individuals, propelling careers and sparking innovation in the professional world. Think of it as an open-source alternative to LinkedIn."
|
||||
}
|
||||
}
|
32
backend/apis/BlinkApiCollection/UpdatePerson.bru
Normal file
32
backend/apis/BlinkApiCollection/UpdatePerson.bru
Normal file
@ -0,0 +1,32 @@
|
||||
meta {
|
||||
name: UpdatePerson
|
||||
type: http
|
||||
seq: 26
|
||||
}
|
||||
|
||||
patch {
|
||||
url: http://localhost:3000/api/people/me
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
User-Agent: insomnia/2023.5.8
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"displayName": "John Junior Doe III",
|
||||
"dateOfBirth": "1970-01-01",
|
||||
"openToWork": "false",
|
||||
"placeOfLiving": "Oslo, Norway",
|
||||
"aboutMe": "I am a passionate software engineer, but I also love art and music",
|
||||
"new_password": "password",
|
||||
"old_password": "password",
|
||||
"qualification" : "Software Engineer at Blink Inc. & Google LLC",
|
||||
"visibility": "EVERYONE",
|
||||
"oldPassword": "password",
|
||||
"newPassword": "password"
|
||||
}
|
||||
}
|
9
backend/apis/BlinkApiCollection/bruno.json
Normal file
9
backend/apis/BlinkApiCollection/bruno.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"version": "1",
|
||||
"name": "Blink",
|
||||
"type": "collection",
|
||||
"ignore": [
|
||||
"node_modules",
|
||||
".git"
|
||||
]
|
||||
}
|
7
backend/apis/BlinkApiCollection/collection.bru
Normal file
7
backend/apis/BlinkApiCollection/collection.bru
Normal file
@ -0,0 +1,7 @@
|
||||
auth {
|
||||
mode: bearer
|
||||
}
|
||||
|
||||
auth:bearer {
|
||||
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwZXJzb25faWQiOjEsImlhdCI6MTc0NDk2OTAxNCwiZXhwIjoxNzQ0OTk3ODE0fQ.eAzcwzTPnNnqmmX9TCUroFLiJxQlQ49fGMVs1bXxXQM
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "Blink",
|
||||
"name": "BlinkApiCollection",
|
||||
"version": "1",
|
||||
"items": [
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ const serverRoutes = require('./routes/server_routes.js');
|
||||
const resetPasswordRoutes = require('./routes/reset_password_routes.js');
|
||||
const applicationRoutes = require('./routes/job_application_routes.js');
|
||||
const personContactInfosRoutes = require('./routes/person_contact_info_routes.js');
|
||||
|
||||
const experienceRoutes = require('./routes/experience_routes.js');
|
||||
/*
|
||||
===== END IMPORTING MODULES =====
|
||||
*/
|
||||
@ -59,7 +59,7 @@ app.use('/api/organizations', organizationAdminRoutes.routes);
|
||||
app.use('/api/resetpassword', resetPasswordRoutes.routes);
|
||||
app.use('/api/organizations', applicationRoutes.routes);
|
||||
app.use('/api/people', personContactInfosRoutes.routes);
|
||||
|
||||
app.use('/api/experiences', experienceRoutes.routes);
|
||||
/*
|
||||
===== END ROUTE HANDLING =====
|
||||
*/
|
||||
|
@ -9,4 +9,34 @@
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
*/
|
||||
*/
|
||||
|
||||
const knex = require('../utils/knex_config');
|
||||
|
||||
function createExperience(title, description, organizationId, organizationName, date, person_id, type) {
|
||||
const experience = {
|
||||
title,
|
||||
description,
|
||||
organization_id: organizationId,
|
||||
organization_name: organizationName,
|
||||
date,
|
||||
person_id,
|
||||
type
|
||||
};
|
||||
return experience;
|
||||
}
|
||||
|
||||
async function insert(experience){
|
||||
const insertedExperience = await knex('Experience')
|
||||
.insert(experience)
|
||||
.returning('*');
|
||||
return insertedExperience[0];
|
||||
}
|
||||
|
||||
// Exporting a function
|
||||
// means making a JavaScript function defined in one
|
||||
// module available for use in another module.
|
||||
module.exports = {
|
||||
createExperience,
|
||||
insert
|
||||
};
|
@ -9,4 +9,36 @@
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
*/
|
||||
*/
|
||||
|
||||
const Experience = require('../models/experience_model');
|
||||
const express = require('express');
|
||||
const jwtUtils = require('../utils/jwt_utils');
|
||||
|
||||
async function addExperience(req, res) {
|
||||
try {
|
||||
const experienceToInsert = Experience.createExperience(
|
||||
req.body.title,
|
||||
req.body.description,
|
||||
req.body.organizationId,
|
||||
req.body.organizationName,
|
||||
req.body.date,
|
||||
req.jwt.person_id,
|
||||
req.body.type
|
||||
)
|
||||
const insertedExperience = await Experience.insert(experienceToInsert);
|
||||
return res.status(201).json(insertedExperience);
|
||||
} catch (error) {
|
||||
console.error(`Error in function ${addExperience.name}: ${error}`);
|
||||
return res.status(500).json({
|
||||
error: 'Internal server error'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const routes = express.Router();
|
||||
routes.post('/', jwtUtils.extractToken, addExperience);
|
||||
|
||||
module.exports = {
|
||||
routes
|
||||
};
|
@ -110,7 +110,7 @@ CREATE TABLE IF NOT EXISTS "Experience" (
|
||||
id SERIAL PRIMARY KEY,
|
||||
title CHARACTER VARYING(128) NOT NULL,
|
||||
description TEXT NOT NULL,
|
||||
organization CHARACTER VARYING(128) NOT NULL,
|
||||
organization_name CHARACTER VARYING(128),
|
||||
organization_id INTEGER,
|
||||
date daterange NOT NULL,
|
||||
person_id INTEGER NOT NULL,
|
||||
@ -150,4 +150,4 @@ CREATE TABLE IF NOT EXISTS "OrganizationContactInfo" (
|
||||
info CHARACTER VARYING(128) NOT NULL,
|
||||
info_type InfoType NOT NULL,
|
||||
CONSTRAINT "OrganizationFK" FOREIGN KEY (organization_id) REFERENCES "Organization" (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE
|
||||
)
|
||||
);
|
||||
|
Reference in New Issue
Block a user