movieComment.ts
678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { Model } from "pinia-orm";
import { Movie } from "~/models/movie";
export class MovieComment extends Model {
/**
*
* @return {string}
*/
static get entity() {
return "MovieComment";
}
/**
*
* @return {string}
*/
static get primaryKey() {
return "id";
}
static fields() {
return {
// Attributs.
id: this.uid(),
createdAt: this.string(""),
username: this.string(""),
message: this.string(""),
rating: this.string(""),
// Relations.
movie_id: this.attr(null),
movie: this.belongsTo(Movie, "movie_id", "id"),
};
}
static piniaOptions = {
persist: true,
};
}