Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 0 additions & 77 deletions api-server/fixtures/payloads/certifications.json5

This file was deleted.

115 changes: 0 additions & 115 deletions api-server/fixtures/payloads/projects.json5

This file was deleted.

37 changes: 28 additions & 9 deletions api-server/routes/cv.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
const express = require('express');
const router = express.Router();
const axios = require('axios');

require('json5/lib/register');
const rapidApiUrl = 'https://linkedin-api8.p.rapidapi.com/';
const linkedInUsername = 'hiroyuki-wakabayashi-61b661157';
const url = rapidApiUrl + '?username=' + linkedInUsername;

axios.defaults.headers.common['x-rapidapi-host'] = 'linkedin-api8.p.rapidapi.com';
axios.defaults.headers.common['x-rapidapi-key'] = process.env.RAPID_API_KEY;


router.get('/', (req, res, next) => {
Expand All @@ -15,16 +21,24 @@ router.get('/', (req, res, next) => {
});
});

router.get('/certifications', function(req, res, next) {
router.get('/certifications', async (req, res, next) => {
// #swagger.tags = ['CV']
// #swagger.summary = '/api/v1/cv/certifications'
// #swagger.description = 'returns list of certifications with static contents'
const certifications = require(__dirname + "/../fixtures/payloads/certifications.json5");
const certificates = await axios.get(url)
.then(response => {
return response.data.certifications
})
.catch(error => {
console.log(error);
})

res.header('Content-Type', 'application/json; charset=utf-8');
res.header({
'Content-Type': 'application/json; charset=utf-8',
});
res.json({
"path": req.originalUrl,
"content": certifications.list.reverse()
"content": certificates
});
});

Expand All @@ -41,16 +55,22 @@ router.get('/educations', function(req, res, next) {
});
});

router.get('/projects', function(req, res, next) {
router.get('/projects', async (req, res, next) => {
// #swagger.tags = ['CV']
// #swagger.summary = 'returns list of projects with static contents'
// #swagger.description = '/api/v1/cv/projects'
const projects = require(__dirname + "/../fixtures/payloads/projects.json5");
const projects = await axios.get(url)
.then(response => {
return response.data.projects
})
.catch(error => {
console.log(error);
})

res.header('Content-Type', 'application/json; charset=utf-8');
res.json({
"path": req.originalUrl,
"content": projects.list.reverse()
"content": projects
});
});

Expand All @@ -65,7 +85,6 @@ router.get('/publications', function(req, res, next) {
// TODO: make dynamically change with http/https
elm.link = 'http://' + req.headers.host + '/api/v1/cv/publications/' + elm.filename
});
console.log(publications.list);

res.header('Content-Type', 'application/json; charset=utf-8');
res.json({
Expand Down
24 changes: 13 additions & 11 deletions web-frontend/src/pages/Cv.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,33 +43,35 @@ axios.get('/api/v1/cv/certifications')
<h3>
Selected Accomplishments
</h3>
<p>
All of the project data has been fetched from <a href="https://www.linkedin.com/in/hiroyuki-wakabayashi-61b661157/" target="_blank" rel="noopener noreferrer">LinkedIn profiles</a>.
</p>

<div v-for="(p, idx) in projectData"
<div v-for="(p, idx) in projectData.items"
:key="idx"
class="project-detail" >
<p>
<h5> {{ p.title }} </h5>
<li v-for="(d, idx) in p.descriptions">
{{ d }}
</li>
<div> {{ p.description }} </div>
<br>
<div> Period: {{ p.start }} - {{ p.end }} </div>
<div> Period: {{ p.start.year }}/{{ p.start.month }} - {{ p.end.year }}/{{ p.end.month }} </div>
<!-- TODO: loop with v-for -->
Skills: {{ p.skills }}
<!-- Since we can not retrieve skills associated to projects from responses of RapidApi, need to consider design -->
<!-- Skills: {{ p.skills }} -->
Comment on lines +50 to +60
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider addressing the TODO comment for v-for loop.

The TODO comment suggests considering a v-for loop for a specific part of the project data. Ensure that the current implementation meets the requirements and consider optimizing if the data structure changes.

Do you need help with implementing the v-for loop or optimizing the rendering logic?

</p>
</div>

<h3>
Certifications
</h3>
<p>
Certified badges are all stored in <a href="https://www.credly.com/users/hiroyuki-wakabayashi.056b817e" target="_blank" rel="noopener noreferrer">Credly Public Profile</a>
</p>
<li v-for="(c, idx) in certificationData"
:key="idx"
class="certification-detail" >
<div v-if="c.credential">
{{ c.date }}: <a :href="c.credential" target="_blank"> {{ c.title }} </a>
</div>
<div v-else>
{{ c.date }}: {{ c.title }}
<div>
{{ c.start.year }}/{{ c.start.month }}: {{ c.name }}
</div>
</li>

Expand Down