Bruno Predot

Ajout attribut createdAt dans le model movieComment + id par défaut en uid().

Gestion de l'evévènement provenant du formulaire de commentaires avec l'ajout de la méthode handleSubmitEvent() dans la page des détails.
------ Dispo à la prochaine release ------------
- Installation vuelidate et vuelidate/validator.
- Ajout composant SkeletonMovieDetailLoader.
- Ajout Model + Interface credit.
- Ajout composant ScoreAndVote.
- Ajout composant MovieGender.
- Ajout composant Poster.
- Ajout composant BackdropImage.
- Ajout composant MovieCommentForm.
- Ajout model + interface MovieComment.
\ No newline at end of file
... ...
... ... @@ -21,7 +21,8 @@ export class MovieComment extends Model {
static fields() {
return {
// Attributs.
id: this.number(null),
id: this.uid(),
createdAt: this.string(''),
username: this.string(''),
message: this.string(''),
rating: this.string(''),
... ...
... ... @@ -7,7 +7,8 @@ import { Movie } from "~/models/movie";
import type { MovieInterface } from "~/interfaces/movie";
import { Credit } from "~/models/credit";
import type { CreditsResponse } from "~/interfaces/credit";
import type { Comment } from "~/type/commentForm";
import type { MovieCommentInterface } from "~/interfaces/movieComment";
import { MovieComment } from "~/models/movieComment";
//#endregion
//#region --Declaration--.
... ... @@ -104,9 +105,12 @@ async function fetchCredits(id: number | string) {
}
}
function handleSubmitEvent(event: Comment) {
//todo : faire la gestion des commentaire avec un nouveau model + liaison.
console.log('submitted', event)
//Ce n'est pas le film du siècle cependant, il est suffisamment intéressant pour passer une bonne soirée !
function handleSubmitEvent(event: MovieCommentInterface) {
isSubmitting.value = true;
event.movie_id = unref(movieId);
useRepo(MovieComment).save(event);
isSubmitting.value = false;
}
//#endregion
... ...