Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
idatt2106-2024-07
frontend
Commits
0a322725
Commit
0a322725
authored
10 months ago
by
Anders Høvik
Browse files
Options
Downloads
Patches
Plain Diff
Fix: fixed missing try-catch in myProfile.
parent
4e3fb5ff
No related branches found
No related tags found
1 merge request
!86
Feature/history endpoint
Pipeline
#283706
failed
10 months ago
Stage: install
Stage: build
Stage: test
Stage: lint
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/UserProfile/MyProfile.vue
+18
-19
18 additions, 19 deletions
src/components/UserProfile/MyProfile.vue
with
18 additions
and
19 deletions
src/components/UserProfile/MyProfile.vue
+
18
−
19
View file @
0a322725
<
script
setup
lang=
"ts"
>
import
{
ref
,
onMounted
,
type
Ref
,
type
UnwrapRef
}
from
"
vue
"
;
import
{
ref
,
onMounted
}
from
"
vue
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
{
useUserInfoStore
}
from
"
../..
/stores/UserStore
"
;
import
{
UserService
,
BadgeService
,
GoalService
,
type
GoalDTO
}
from
"
@/api
"
;
import
{
useUserInfoStore
}
from
"
@
/stores/UserStore
"
;
import
{
UserService
,
BadgeService
,
GoalService
,
type
GoalDTO
,
type
BadgeDTO
}
from
"
@/api
"
;
import
{
ItemService
}
from
"
@/api
"
;
let
numberOfHistory
=
6
;
...
...
@@ -15,7 +15,7 @@ let hasHistory = ref(true)
const
router
=
useRouter
();
const
inventory
=
ref
([]
as
any
);
const
badges
=
ref
([]
as
any
);
const
badges
=
ref
<
BadgeDTO
[]
>
([]
);
const
backgroundName
=
ref
(
""
);
...
...
@@ -27,17 +27,18 @@ let createdAt = ref('');
let
goals
=
ref
<
GoalDTO
[]
>
([])
async
function
getGoals
()
{
goals
.
value
=
await
GoalService
.
getGoals
();
console
.
log
(
"
number of goals:
"
,
goals
.
value
.
length
)
console
.
log
(
'
The id of a goal:
'
,
goals
.
value
[
0
])
if
(
goals
.
value
.
length
>
0
)
{
hasHistory
.
value
=
true
}
else
{
hasHistory
.
value
=
false
console
.
log
(
'
No history
'
)
try
{
goals
.
value
=
await
GoalService
.
getGoals
();
console
.
log
(
"
number of goals:
"
,
goals
.
value
.
length
)
console
.
log
(
'
The id of a goal:
'
,
goals
.
value
[
0
])
if
(
goals
.
value
.
length
>
0
)
{
hasHistory
.
value
=
true
}
else
{
hasHistory
.
value
=
false
console
.
log
(
'
No history
'
)
}
}
catch
(
error
){
console
.
error
(
"
Something went wrong
"
,
error
)
}
}
...
...
@@ -85,6 +86,7 @@ const selectItem = (item: any) => {
onMounted
(()
=>
{
setupForm
()
getGoals
()
})
const
toRoadmap
=
()
=>
{
...
...
@@ -98,9 +100,6 @@ const toUpdateUserSettings = () => {
router
.
push
(
'
/settings/profile
'
);
};
onMounted
(()
=>
{
getGoals
()
})
</
script
>
...
...
@@ -279,7 +278,7 @@ onMounted(()=>{
}
#banner
{
background-image
:
url('
..
/src/assets/banners/stacked.svg')
;
background-image
:
url('/src/assets/banners/stacked.svg')
;
}
.card-1
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment