Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Projet tutoré S5
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
Container 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
DUCRUET THIBAULT p2306959
Projet tutoré S5
Commits
57aa8dbd
Commit
57aa8dbd
authored
1 year ago
by
Bastien
Browse files
Options
Downloads
Patches
Plain Diff
affichage films vus sur page d'mon compte
parent
1685d4e9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/views/MonCompte.vue
+25
-3
25 additions, 3 deletions
frontend/src/views/MonCompte.vue
with
25 additions
and
3 deletions
frontend/src/views/MonCompte.vue
+
25
−
3
View file @
57aa8dbd
<
script
setup
>
import
Header
from
'
@/components/Header.vue
'
import
FilmRow
from
'
@/components/FilmRow.vue
'
import
{
ref
,
onMounted
}
from
'
vue
'
;
...
...
@@ -7,6 +8,7 @@ let username = ref('');
let
firstname
=
ref
(
''
);
let
lastname
=
ref
(
''
);
let
birthdate
=
ref
(
''
);
let
mesFilmsVus
=
ref
([])
function
getUserInfo
()
{
const
req
=
fetch
(
'
http://localhost:3000/user
'
,
{
credentials
:
'
include
'
}).
then
(
response
=>
{
...
...
@@ -28,6 +30,27 @@ function getUserInfo() {
}
async
function
fetchSeenMovies
()
{
try
{
const
response
=
await
fetch
(
'
http://localhost:3000/user/seenMovies
'
,
{
credentials
:
'
include
'
});
if
(
response
.
ok
)
{
const
data
=
await
response
.
json
();
if
(
data
)
{
console
.
log
(
data
);
mesFilmsVus
.
value
=
data
;
}
}
else
{
const
errorData
=
await
response
.
json
();
console
.
error
(
'
Error:
'
,
response
.
status
,
errorData
);
}
}
catch
(
error
)
{
console
.
error
(
'
Error during API call:
'
,
error
);
}
}
onMounted
(()
=>
{
getUserInfo
();
});
...
...
@@ -48,9 +71,8 @@ onMounted(() => {
<button>
Changer de nom d'utilisateur
</button>
<button>
Changer de mot de passe
</button>
</div>
<h1>
Films préférés :
</h1>
<h1>
Films préférés :
</h1>
<FilmRow
:films=
"mesFilmsVus"
></FilmRow>
</
template
>
<
style
scoped
>
...
...
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