@platform-modules/foreign-ministry 1.0.43 → 1.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,13 +4,13 @@ import { User } from './user';
|
|
|
4
4
|
export declare class Comments extends BaseModel {
|
|
5
5
|
post_id: number;
|
|
6
6
|
user_id: number;
|
|
7
|
-
|
|
7
|
+
reply_to_comment_id?: number;
|
|
8
8
|
content: string;
|
|
9
9
|
created_at: Date;
|
|
10
10
|
updated_at: Date;
|
|
11
11
|
post?: Posts;
|
|
12
12
|
user?: User;
|
|
13
|
-
|
|
13
|
+
replyToComment?: Comments;
|
|
14
14
|
replies?: Comments[];
|
|
15
15
|
constructor();
|
|
16
16
|
}
|
|
@@ -19,7 +19,7 @@ let Comments = class Comments extends BaseModel_1.BaseModel {
|
|
|
19
19
|
super();
|
|
20
20
|
this.post_id = 0;
|
|
21
21
|
this.user_id = 0;
|
|
22
|
-
this.
|
|
22
|
+
this.reply_to_comment_id = 0;
|
|
23
23
|
this.content = '';
|
|
24
24
|
this.created_at = new Date();
|
|
25
25
|
this.updated_at = new Date();
|
|
@@ -37,7 +37,7 @@ __decorate([
|
|
|
37
37
|
__decorate([
|
|
38
38
|
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
39
39
|
__metadata("design:type", Number)
|
|
40
|
-
], Comments.prototype, "
|
|
40
|
+
], Comments.prototype, "reply_to_comment_id", void 0);
|
|
41
41
|
__decorate([
|
|
42
42
|
(0, typeorm_1.Column)({ type: 'text', nullable: false }),
|
|
43
43
|
__metadata("design:type", String)
|
|
@@ -62,11 +62,11 @@ __decorate([
|
|
|
62
62
|
], Comments.prototype, "user", void 0);
|
|
63
63
|
__decorate([
|
|
64
64
|
(0, typeorm_1.ManyToOne)(() => Comments, comment => comment.id),
|
|
65
|
-
(0, typeorm_1.JoinColumn)({ name: '
|
|
65
|
+
(0, typeorm_1.JoinColumn)({ name: 'reply_to_comment_id' }),
|
|
66
66
|
__metadata("design:type", Comments)
|
|
67
|
-
], Comments.prototype, "
|
|
67
|
+
], Comments.prototype, "replyToComment", void 0);
|
|
68
68
|
__decorate([
|
|
69
|
-
(0, typeorm_1.OneToMany)(() => Comments, comment => comment.
|
|
69
|
+
(0, typeorm_1.OneToMany)(() => Comments, comment => comment.replyToComment),
|
|
70
70
|
__metadata("design:type", Array)
|
|
71
71
|
], Comments.prototype, "replies", void 0);
|
|
72
72
|
exports.Comments = Comments = __decorate([
|
|
@@ -27,6 +27,7 @@ let Posts = class Posts extends BaseModel_1.BaseModel {
|
|
|
27
27
|
this.category_id = 0;
|
|
28
28
|
this.created_at = new Date();
|
|
29
29
|
this.updated_at = new Date();
|
|
30
|
+
this.is_bookmarked = false;
|
|
30
31
|
}
|
|
31
32
|
};
|
|
32
33
|
exports.Posts = Posts;
|
|
@@ -58,6 +59,10 @@ __decorate([
|
|
|
58
59
|
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
59
60
|
__metadata("design:type", Date)
|
|
60
61
|
], Posts.prototype, "updated_at", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
64
|
+
__metadata("design:type", Boolean)
|
|
65
|
+
], Posts.prototype, "is_bookmarked", void 0);
|
|
61
66
|
__decorate([
|
|
62
67
|
(0, typeorm_1.ManyToOne)(() => user_1.User, user => user.id),
|
|
63
68
|
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ export class Comments extends BaseModel {
|
|
|
13
13
|
user_id: number;
|
|
14
14
|
|
|
15
15
|
@Column({ type: 'int', nullable: true })
|
|
16
|
-
|
|
16
|
+
reply_to_comment_id?: number;
|
|
17
17
|
|
|
18
18
|
@Column({ type: 'text', nullable: false })
|
|
19
19
|
content: string;
|
|
@@ -34,17 +34,17 @@ export class Comments extends BaseModel {
|
|
|
34
34
|
user?: User;
|
|
35
35
|
|
|
36
36
|
@ManyToOne(() => Comments, comment => comment.id)
|
|
37
|
-
@JoinColumn({ name: '
|
|
38
|
-
|
|
37
|
+
@JoinColumn({ name: 'reply_to_comment_id' })
|
|
38
|
+
replyToComment?: Comments;
|
|
39
39
|
|
|
40
|
-
@OneToMany(() => Comments, comment => comment.
|
|
40
|
+
@OneToMany(() => Comments, comment => comment.replyToComment)
|
|
41
41
|
replies?: Comments[];
|
|
42
42
|
|
|
43
43
|
constructor() {
|
|
44
44
|
super();
|
|
45
45
|
this.post_id = 0;
|
|
46
46
|
this.user_id = 0;
|
|
47
|
-
this.
|
|
47
|
+
this.reply_to_comment_id = 0;
|
|
48
48
|
this.content = '';
|
|
49
49
|
this.created_at = new Date();
|
|
50
50
|
this.updated_at = new Date();
|
package/src/models/PostsModel.ts
CHANGED
|
@@ -30,6 +30,9 @@ export class Posts extends BaseModel {
|
|
|
30
30
|
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
31
31
|
updated_at: Date;
|
|
32
32
|
|
|
33
|
+
@Column({ type: 'boolean', default: false })
|
|
34
|
+
is_bookmarked: boolean;
|
|
35
|
+
|
|
33
36
|
// Relations
|
|
34
37
|
@ManyToOne(() => User, user => user.id)
|
|
35
38
|
@JoinColumn({ name: 'user_id' })
|
|
@@ -58,5 +61,6 @@ export class Posts extends BaseModel {
|
|
|
58
61
|
this.category_id = 0;
|
|
59
62
|
this.created_at = new Date();
|
|
60
63
|
this.updated_at = new Date();
|
|
64
|
+
this.is_bookmarked = false;
|
|
61
65
|
}
|
|
62
66
|
}
|