Skip to content
Snippets Groups Projects
Commit 5414fab5 authored by Bilel El Yaagoubi's avatar Bilel El Yaagoubi
Browse files

advancement

parent 80bc4ae0
No related branches found
No related tags found
1 merge request!8Movie page
Pipeline #42600 passed
...@@ -3,11 +3,14 @@ ...@@ -3,11 +3,14 @@
<div class="child"> <div class="child">
<h1>{{ movieTitle }}</h1> <h1>{{ movieTitle }}</h1>
<div class="mark"> <div class="mark">
<h2>{{ movieVoteAverage }}</h2> <h2>{{ movieVoteAverage * 0.5 }}</h2>
</div> </div>
</div> </div>
<h4>Genres : {{ genreArray.join(", ") }}</h4> <h4>Genres : {{ genreArray.join(", ") }}</h4>
<h4>{{ movieOverview }}</h4> <h4>{{ movieOverview }}</h4>
<div class="like_button" v-on:click="handleLike">
<h2>{{ liking }}</h2>
</div>
</div> </div>
</template> </template>
...@@ -19,9 +22,12 @@ export default { ...@@ -19,9 +22,12 @@ export default {
data: function () { data: function () {
return { return {
genreArray: [], genreArray: [],
liking: "Unlike",
userId: "toto",
}; };
}, },
props: { props: {
movieId: Number,
movieTitle: String, movieTitle: String,
movieDate: String, movieDate: String,
movieGenres: Array, movieGenres: Array,
...@@ -48,11 +54,20 @@ export default { ...@@ -48,11 +54,20 @@ export default {
console.log(error); console.log(error);
} }
}, },
handleLike: async function () {
console.log("clic");
await axios.put(backendURL + "/users/like/", {
userId: this.userId,
movieId: this.movieId,
});
},
}, },
created() { created() {
this.developGenres(this.movieGenres).then((results) => { this.developGenres(this.movieGenres).then((results) => {
this.genreArray = results; this.genreArray = results;
}); });
this.userId = this.$route.query.uid;
console.log(this.userId);
}, },
}; };
</script> </script>
...@@ -76,4 +91,16 @@ export default { ...@@ -76,4 +91,16 @@ export default {
border-radius: 25%; border-radius: 25%;
margin-left: auto; margin-left: auto;
} }
.like_button {
text-align: center;
vertical-align: center;
background-color: #912f56;
border-radius: 2%;
width: 90%;
margin-top: auto;
margin-left: auto;
margin-right: auto;
margin-bottom: auto;
cursor: pointer;
}
</style> </style>
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<MoviePoster class="child" :posterPath="moviesInfos.poster_path" /> <MoviePoster class="child" :posterPath="moviesInfos.poster_path" />
<MovieInfos <MovieInfos
class="child" class="child"
:movieId="moviesInfos.id"
:movieTitle="moviesInfos.title" :movieTitle="moviesInfos.title"
:movieDate="moviesInfos.release_date" :movieDate="moviesInfos.release_date"
:movieGenres="moviesInfos.genre_ids" :movieGenres="moviesInfos.genre_ids"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment