Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-155
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-155
2021-155
Commits
41c85c0d
Commit
41c85c0d
authored
Jul 05, 2021
by
Kamal Thennakoon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix portfolio creation issue
parent
d389a8c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
26 deletions
+32
-26
client/actions/portfolio.js
client/actions/portfolio.js
+22
-18
client/pages/portfolio/[username].js
client/pages/portfolio/[username].js
+10
-8
No files found.
client/actions/portfolio.js
View file @
41c85c0d
...
...
@@ -16,9 +16,9 @@ export async function checkUserValidty(username) {
const
url
=
`http://localhost:3001/api/user-validity/?username=
${
username
}
`
try
{
const
response
=
await
Axios
.
get
(
url
);
console
.
log
(
'
hi
'
,
response
)
const
data
=
response
.
data
console
.
log
(
data
)
console
.
log
(
'
chk-01
'
,
data
)
return
data
}
catch
(
err
)
{
console
.
log
(
'
REST error:
'
,
err
);
...
...
@@ -30,7 +30,7 @@ export async function checkPortfolioExists(username) {
try
{
const
response
=
await
Axios
.
get
(
url
)
const
data
=
response
.
data
console
.
log
(
data
)
console
.
log
(
'
portfolio exsitance-02:
'
,
data
)
return
data
}
catch
(
err
)
{
console
.
log
(
'
REST error:
'
,
err
);
...
...
@@ -53,9 +53,9 @@ export async function createPortfolio(username) {
const
url
=
`http://localhost:8000/api/user/create/
${
username
}
`
try
{
const
response
=
await
Axios
.
post
(
url
)
console
.
log
(
response
)
const
data
=
response
.
data
console
.
log
(
data
)
console
.
log
(
'
portfolio creation-03
'
,
data
)
return
data
}
catch
(
err
)
{
console
.
log
(
'
REST error:
'
,
err
);
...
...
@@ -70,19 +70,23 @@ export async function saveGithubInfo(userInfo) {
method
:
'
POST
'
,
url
:
'
http://localhost:8000/api/user/save-git-info
'
,
data
:
{
name
:
userInfo
.
summary
.
name
,
username
:
userInfo
.
summary
.
name
,
avatar_url
:
userInfo
.
user
.
avatar
,
location
:
userInfo
.
user
.
location
,
bio
:
userInfo
.
user
.
bio
,
total_star_received
:
userInfo
.
summary
.
totalStars
,
total_prs
:
userInfo
.
summary
.
totalPRs
,
total_commits
:
userInfo
.
summary
.
totalCommits
,
total_issues
:
userInfo
.
summary
.
totalIssues
,
contributed_to
:
userInfo
.
summary
.
contributedTo
,
level
:
userInfo
.
summary
.
rank
.
level
,
score
:
userInfo
.
summary
.
rank
.
score
name
:
userInfo
.
summary
.
stats
.
name
,
username
:
userInfo
.
summary
.
userBio
.
username
,
avatar_url
:
userInfo
.
summary
.
userBio
.
avatar_url
,
bio
:
userInfo
.
summary
.
userBio
.
bio
,
company
:
userInfo
.
summary
.
userBio
.
company
,
created_at
:
userInfo
.
summary
.
userBio
.
created_at
,
location
:
userInfo
.
summary
.
userBio
.
location
,
total_stars
:
userInfo
.
summary
.
stats
.
totalStars
,
total_prs
:
userInfo
.
summary
.
stats
.
totalPRs
,
total_commits
:
userInfo
.
summary
.
stats
.
totalCommits
,
total_issues
:
userInfo
.
summary
.
stats
.
totalIssues
,
contributed_to
:
userInfo
.
summary
.
stats
.
contributedTo
,
git_level
:
userInfo
.
summary
.
stats
.
rank
.
level
,
git_score
:
userInfo
.
summary
.
stats
.
rank
.
score
,
git_points
:
userInfo
.
summary
.
stats
.
rank
.
points
,
git_badge
:
userInfo
.
summary
.
stats
.
rank
.
badge
,
}
});
console
.
log
(
response
);
...
...
client/pages/portfolio/[username].js
View file @
41c85c0d
...
...
@@ -13,7 +13,7 @@ import {
import
{
Rating
}
from
'
@material-ui/lab
'
import
{
useRouter
}
from
'
next/router
'
import
React
,
{
useEffect
}
from
'
react
'
import
{
getGithubInfo
,
saveGithubInfo
}
from
'
../../actions/portfolio
'
import
{
get
AllPortfolios
,
get
GithubInfo
,
saveGithubInfo
}
from
'
../../actions/portfolio
'
import
Header
from
'
../../components/layout/header
'
import
BlogCard
from
'
../../components/portfolio/blog-card/blog-card
'
import
FavLanguageCard
from
'
../../components/portfolio/fav-language-card/fav-language-card
'
...
...
@@ -74,7 +74,7 @@ function Porto({ gitInfo }) {
<
Card
className
=
{
classes
.
cardWidth
}
>
<
CardMedia
className
=
{
classes
.
propic
}
image
=
"
/images/portfolio/profile-01.jpg
"
image
=
{
gitInfo
.
summary
.
userBio
.
avatar_url
}
title
=
"
Profile picture
"
/>
<
/Card
>
...
...
@@ -90,9 +90,10 @@ function Porto({ gitInfo }) {
justify
=
"
space-around
"
>
{
/* Reputation Bars */
}
<
ReputationIndicator
><
/ReputationIndicator
>
<
ReputationIndicator
><
/ReputationIndicator
>
<
ReputationIndicator
><
/ReputationIndicator
>
<
ReputationIndicator
area
=
'
stackOveflow
'
rank
=
{{
level
:
30
,
badge
:
'
none
'
}}
><
/ReputationIndicator
>
<
ReputationIndicator
area
=
'
GitHub
'
rank
=
{
gitInfo
.
summary
.
stats
.
rank
}
><
/ReputationIndicator
>
<
ReputationIndicator
area
=
'
stackOveflow
'
rank
=
{{
level
:
30
,
badge
:
'
none
'
}}
><
/ReputationIndicator
>
{
/* Reputation Bars End */
}
<
/Grid
>
<
/Grid
>
...
...
@@ -231,14 +232,15 @@ function Porto({ gitInfo }) {
export
default
Porto
export
async
function
getStaticPaths
()
{
const
posts
=
[
'
tmKamal
'
,
'
grayAlpha
'
,
'
greyAlpha
'
]
// const posts = ['tmKamal', 'grayAlpha', 'greyAlpha','dasunx']
const
posts
=
await
getAllPortfolios
();
// Get the paths we want to pre-render based on posts
const
paths
=
posts
.
map
((
post
)
=>
({
params
:
{
username
:
post
}
params
:
{
username
:
post
.
username
.
toLowerCase
()
}
}))
// We'll pre-render only these paths at build time.
// { fallback: false } means other routes should 404.
return
{
paths
,
fallback
:
false
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment